{"action":"opened","issue":{"url":"https://api.github.com/repos/CollectionFS/Meteor-CollectionFS/issues/530","labels_url":"https://api.github.com/repos/CollectionFS/Meteor-CollectionFS/issues/530/labels{/name}","comments_url":"https://api.github.com/repos/CollectionFS/Meteor-CollectionFS/issues/530/comments","events_url":"https://api.github.com/repos/CollectionFS/Meteor-CollectionFS/issues/530/events","html_url":"https://github.com/CollectionFS/Meteor-CollectionFS/issues/530","id":56482760,"number":530,"title":"FileObject.url() - Meteor crash","user":{"login":"szimmer1","id":8455475,"avatar_url":"https://avatars.githubusercontent.com/u/8455475?v=3","gravatar_id":"","url":"https://api.github.com/users/szimmer1","html_url":"https://github.com/szimmer1","followers_url":"https://api.github.com/users/szimmer1/followers","following_url":"https://api.github.com/users/szimmer1/following{/other_user}","gists_url":"https://api.github.com/users/szimmer1/gists{/gist_id}","starred_url":"https://api.github.com/users/szimmer1/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/szimmer1/subscriptions","organizations_url":"https://api.github.com/users/szimmer1/orgs","repos_url":"https://api.github.com/users/szimmer1/repos","events_url":"https://api.github.com/users/szimmer1/events{/privacy}","received_events_url":"https://api.github.com/users/szimmer1/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-02-04T05:36:23Z","updated_at":"2015-02-04T05:36:23Z","closed_at":null,"body":"Hi, \r\n\r\nI'm getting a meteor crash with:\r\n\r\n    throw new Error('Can\\'t render headers after they are sent to the client.'\r\n\r\nI have narrowed the error down to occurring when I try to get a image url by store:\r\n    \r\n    var image = Images.findOne({_id: someId})\r\n    var url = image.url({store: thumbnailStore})\r\n\r\nLooking through the url() source reveals that the function may alter the response headers when the store option is defined\r\n\r\n    if (options.store) { \r\n          // We use options.store here instead of storeName because we want to omit the queryString                      \r\n          // whenever possible, allowing users to have \"clean\" URLs if they want. The server will                         \r\n          // assume the first store defined on the server, which means that we are assuming that                          \r\n          // the first on the client is also the first on the server. If that's not the case, the                       \r\n          // store option should be supplied.                                                                         \r\n          params.store = options.store;                                                                                   \r\n        }\r\n\r\nAny ideas on how to work around?\r\n    \r\n"}}