{"action":"created","issue":{"url":"https://api.github.com/repos/VeliovGroup/Meteor-Files/issues/327","repository_url":"https://api.github.com/repos/VeliovGroup/Meteor-Files","labels_url":"https://api.github.com/repos/VeliovGroup/Meteor-Files/issues/327/labels{/name}","comments_url":"https://api.github.com/repos/VeliovGroup/Meteor-Files/issues/327/comments","events_url":"https://api.github.com/repos/VeliovGroup/Meteor-Files/issues/327/events","html_url":"https://github.com/VeliovGroup/Meteor-Files/issues/327","id":200561978,"number":327,"title":"File download not possible in IE11 (Internet Explorer) - VeliovGroup/Meteor-Cookies problem?","user":{"login":"derwok","id":4393698,"avatar_url":"https://avatars.githubusercontent.com/u/4393698?v=3","gravatar_id":"","url":"https://api.github.com/users/derwok","html_url":"https://github.com/derwok","followers_url":"https://api.github.com/users/derwok/followers","following_url":"https://api.github.com/users/derwok/following{/other_user}","gists_url":"https://api.github.com/users/derwok/gists{/gist_id}","starred_url":"https://api.github.com/users/derwok/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/derwok/subscriptions","organizations_url":"https://api.github.com/users/derwok/orgs","repos_url":"https://api.github.com/users/derwok/repos","events_url":"https://api.github.com/users/derwok/events{/privacy}","received_events_url":"https://api.github.com/users/derwok/received_events","type":"User","site_admin":false},"labels":[{"id":200431640,"url":"https://api.github.com/repos/VeliovGroup/Meteor-Files/labels/bug","name":"bug","color":"fc2929","default":true},{"id":403111588,"url":"https://api.github.com/repos/VeliovGroup/Meteor-Files/labels/MS%20Windows","name":"MS Windows","color":"0052cc","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":7,"created_at":"2017-01-13T07:07:43Z","updated_at":"2017-01-19T17:03:19Z","closed_at":null,"body":"**meteor 1.4.2.3\r\nostrio:cookies@2.0.5\r\nostrio:files@1.7.6**\r\n\r\nUnfortunately we have to support IE11  :-( (I know, I know... - sad world).\r\nVeliovGroup/Meteor-Files works great with all other browsers - so we where hit by surprise when we found out the infamous IE11 makes trouble again, here...  :-(\r\n\r\nSo what happens?\r\nWith IE11 it is possible to upload and remove files. But it is not possible to download files with an URL like this, while having a downloadCallback that checks for a logged in user:\r\nhttp://www.myserver.com:3100/cdn/storage/AttachmentsCollection/oDYpTaG7k7xQGNEW3/original/oDYpTaG7k7xQGNEW3.txt?download=true\r\n\r\n** IE11 gives a \"HTTP 404\" error.**\r\n\r\nWe have to protect files against not logged in users. Looking on the server the 404 problem seems to be as our `FilesCollection/downloadCallback` returns a \"false\" here:\r\n\r\n        if (! this.userId) {\r\n            console.log(\"Attachment download prohibited. User not logged in.\");\r\n            return false;\r\n        }\r\n\r\nIf we dump the \"this\" in the above context we see that there is actually no `userId` available:\r\n\r\n    [...]\r\n    I20170113-07:56:19.481(1)?   params:\r\n    I20170113-07:56:19.483(1)?    { query: { download: 'true' },\r\n    I20170113-07:56:19.484(1)?      _id: 'oDYpTaG7k7xQGNEW3',\r\n    I20170113-07:56:19.484(1)?      version: 'original',\r\n    I20170113-07:56:19.484(1)?      name: 'oDYpTaG7k7xQGNEW3.txt?download=true' },\r\n    I20170113-07:56:19.494(1)?   user: [Function: user],\r\n    I20170113-07:56:19.494(1)?   userId: null }\r\n\r\nTaking a closer look at the server log we see that the problem seems to arise way before the actual download. If the IE11 user signs in to our app with the meteor accounts package we see this in the error log:\r\n\r\n```\r\nW20170113-07:37:52.782(1)? (STDERR) Error: `value` required in setHeader(\"Set-Cookie\", value).\r\nW20170113-07:37:52.782(1)? (STDERR)     at ServerResponse.OutgoingMessage.setHeader (_http_outgoing.js:342:11)\r\nW20170113-07:37:52.782(1)? (STDERR)     at ServerResponse.appendHeader (/Users/wok/.meteor/packages/webapp/.1.3.12.10jgpt3++os+web.browser+web.cordova/npm/node_modules/connect/lib/patch.js:95:33)\r\nW20170113-07:37:52.782(1)? (STDERR)     at ServerResponse.res.setHeader (/Users/wok/.meteor/packages/webapp/.1.3.12.10jgpt3++os+web.browser+web.cordova/npm/node_modules/connect/lib/patch.js:126:19)\r\nW20170113-07:37:52.783(1)? (STDERR)     at Object.handle (packages/ostrio_cookies.js:509:21)\r\nW20170113-07:37:52.784(1)? (STDERR)     at next (/Users/wok/.meteor/packages/webapp/.1.3.12.10jgpt3++os+web.browser+web.cordova/npm/node_modules/connect/lib/proto.js:174:15)\r\nW20170113-07:37:52.784(1)? (STDERR)     at Function.app.handle (/Users/wok/.meteor/packages/webapp/.1.3.12.10jgpt3++os+web.browser+web.cordova/npm/node_modules/connect/lib/proto.js:182:3)\r\nW20170113-07:37:52.784(1)? (STDERR)     at Object.fn [as handle] (/Users/wok/.meteor/packages/webapp/.1.3.12.10jgpt3++os+web.browser+web.cordova/npm/node_modules/connect/lib/proto.js:79:14)\r\nW20170113-07:37:52.785(1)? (STDERR)     at next (/Users/wok/.meteor/packages/webapp/.1.3.12.10jgpt3++os+web.browser+web.cordova/npm/node_modules/connect/lib/proto.js:174:15)\r\nW20170113-07:37:52.785(1)? (STDERR)     at Object.WebAppInternals.staticFilesMiddleware (packages/webapp/webapp_server.js:369:5)\r\nW20170113-07:37:52.785(1)? (STDERR)     at packages/webapp/webapp_server.js:642:22\r\n```\r\nIn the context of meteors \"staticFilesMiddleware\" here this line of interest: `at Object.handle (packages/ostrio_cookies.js:509:21)`\r\nSo, the root cause seems to be a problem with **VeliovGroup/Meteor-Cookies** here.\r\n(By the way: should we file the issue over there?!)\r\n\r\nWould be great if you could have look into this issue?\r\n\r\nThanks for all your great work!\r\nWe hobe you have a clue what's going on here...\r\n\r\nThanks in advance.\r\nWolfram.\r\n"},"comment":{"url":"https://api.github.com/repos/VeliovGroup/Meteor-Files/issues/comments/273834686","html_url":"https://github.com/VeliovGroup/Meteor-Files/issues/327#issuecomment-273834686","issue_url":"https://api.github.com/repos/VeliovGroup/Meteor-Files/issues/327","id":273834686,"user":{"login":"derwok","id":4393698,"avatar_url":"https://avatars.githubusercontent.com/u/4393698?v=3","gravatar_id":"","url":"https://api.github.com/users/derwok","html_url":"https://github.com/derwok","followers_url":"https://api.github.com/users/derwok/followers","following_url":"https://api.github.com/users/derwok/following{/other_user}","gists_url":"https://api.github.com/users/derwok/gists{/gist_id}","starred_url":"https://api.github.com/users/derwok/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/derwok/subscriptions","organizations_url":"https://api.github.com/users/derwok/orgs","repos_url":"https://api.github.com/users/derwok/repos","events_url":"https://api.github.com/users/derwok/events{/privacy}","received_events_url":"https://api.github.com/users/derwok/received_events","type":"User","site_admin":false},"created_at":"2017-01-19T17:03:19Z","updated_at":"2017-01-19T17:03:19Z","body":"Hey! Great News! Yes, sure! I'll try! Stay tuned."}}
{"actor":{"display_login":"derwok"}}