{"action":"closed","issue":{"url":"https://api.github.com/repos/PolymerElements/iron-ajax/issues/55","labels_url":"https://api.github.com/repos/PolymerElements/iron-ajax/issues/55/labels{/name}","comments_url":"https://api.github.com/repos/PolymerElements/iron-ajax/issues/55/comments","events_url":"https://api.github.com/repos/PolymerElements/iron-ajax/issues/55/events","html_url":"https://github.com/PolymerElements/iron-ajax/issues/55","id":86721145,"number":55,"title":"Refuse to make auto request if url is an empty string","user":{"login":"zacharytamas","id":581096,"avatar_url":"https://avatars.githubusercontent.com/u/581096?v=3","gravatar_id":"","url":"https://api.github.com/users/zacharytamas","html_url":"https://github.com/zacharytamas","followers_url":"https://api.github.com/users/zacharytamas/followers","following_url":"https://api.github.com/users/zacharytamas/following{/other_user}","gists_url":"https://api.github.com/users/zacharytamas/gists{/gist_id}","starred_url":"https://api.github.com/users/zacharytamas/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zacharytamas/subscriptions","organizations_url":"https://api.github.com/users/zacharytamas/orgs","repos_url":"https://api.github.com/users/zacharytamas/repos","events_url":"https://api.github.com/users/zacharytamas/events{/privacy}","received_events_url":"https://api.github.com/users/zacharytamas/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":{"login":"cdata","id":240083,"avatar_url":"https://avatars.githubusercontent.com/u/240083?v=3","gravatar_id":"","url":"https://api.github.com/users/cdata","html_url":"https://github.com/cdata","followers_url":"https://api.github.com/users/cdata/followers","following_url":"https://api.github.com/users/cdata/following{/other_user}","gists_url":"https://api.github.com/users/cdata/gists{/gist_id}","starred_url":"https://api.github.com/users/cdata/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cdata/subscriptions","organizations_url":"https://api.github.com/users/cdata/orgs","repos_url":"https://api.github.com/users/cdata/repos","events_url":"https://api.github.com/users/cdata/events{/privacy}","received_events_url":"https://api.github.com/users/cdata/received_events","type":"User","site_admin":false},"milestone":null,"comments":10,"created_at":"2015-06-09T20:14:43Z","updated_at":"2015-10-22T21:36:56Z","closed_at":"2015-10-22T21:36:56Z","body":"I have an annoying behavior of `iron-ajax` that has bitten me a few times so I'm curious if we could get some discussion about this. Example, if you have an `iron-ajax` defined as so:\r\n\r\n    <iron-ajax auto url=\"[[_urlFor(user)]]\"></iron-ajax>\r\n\r\nHere, `_urlFor(user)` is a [computed binding](https://www.polymer-project.org/1.0/docs/devguide/data-binding.html#annotated-computed). Polymer 1.0 is smart enough to not set this value until `user` is defined the first time, so if `user` is null, the `iron-ajax` element's `url` property becomes the default empty string. However, the `auto` mode of the `iron-ajax` element will **make it make a request anyway**: to the root of the domain your browser is on. \r\n\r\nThe problem I'm having is that it auto-requests before binding completes. For example, if I have something roughly like this (even though this syntax is wrong, just understand `my-element` has a property named `userId`):\r\n\r\n    <my-element user-id=\"zuck\">\r\n        <!-- in shadow -->\r\n        <iron-ajax auto url=\"[[_urlFor(userId)]]\"></iron-ajax>\r\n    </my-element>\r\n\r\nWhen creating the `my-element` it creates the `iron-ajax` which immediately sends a request though its url is empty. Fractions of a second later, back in `my-element` it finishes creating its DOM and sets up the bindings, this causes `iron-ajax` to update its url using the computed binding, setting the right URL.\r\n\r\nSo when the dust settles I have a spurious request that is almost guaranteed to be pointless, followed immediately by the legitimate request that I expect.\r\n\r\n**A possible fix** for this would be simply to make the auto-request require that the url is not an empty string, otherwise not actually make the request. If you *did* need to hit the root, you would set the url as simply `/`, which is what most people would do anyway.\r\n\r\nWhat do you think?"}}