Skip to content

File download not possible in IE11 (Internet Explorer) - VeliovGroup/Meteor-Cookies problem? #327

@derwok

Description

@derwok

meteor 1.4.2.3
ostrio:cookies@2.0.5
ostrio:files@1.7.6

Unfortunately we have to support IE11 :-( (I know, I know... - sad world).
VeliovGroup/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... :-(

So what happens?
With 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:
http://www.myserver.com:3100/cdn/storage/AttachmentsCollection/oDYpTaG7k7xQGNEW3/original/oDYpTaG7k7xQGNEW3.txt?download=true

** IE11 gives a "HTTP 404" error.**

We 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:

    if (! this.userId) {
        console.log("Attachment download prohibited. User not logged in.");
        return false;
    }

If we dump the "this" in the above context we see that there is actually no userId available:

[...]
I20170113-07:56:19.481(1)?   params:
I20170113-07:56:19.483(1)?    { query: { download: 'true' },
I20170113-07:56:19.484(1)?      _id: 'oDYpTaG7k7xQGNEW3',
I20170113-07:56:19.484(1)?      version: 'original',
I20170113-07:56:19.484(1)?      name: 'oDYpTaG7k7xQGNEW3.txt?download=true' },
I20170113-07:56:19.494(1)?   user: [Function: user],
I20170113-07:56:19.494(1)?   userId: null }

Taking 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:

W20170113-07:37:52.782(1)? (STDERR) Error: `value` required in setHeader("Set-Cookie", value).
W20170113-07:37:52.782(1)? (STDERR)     at ServerResponse.OutgoingMessage.setHeader (_http_outgoing.js:342:11)
W20170113-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)
W20170113-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)
W20170113-07:37:52.783(1)? (STDERR)     at Object.handle (packages/ostrio_cookies.js:509:21)
W20170113-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)
W20170113-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)
W20170113-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)
W20170113-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)
W20170113-07:37:52.785(1)? (STDERR)     at Object.WebAppInternals.staticFilesMiddleware (packages/webapp/webapp_server.js:369:5)
W20170113-07:37:52.785(1)? (STDERR)     at packages/webapp/webapp_server.js:642:22

In the context of meteors "staticFilesMiddleware" here this line of interest: at Object.handle (packages/ostrio_cookies.js:509:21)
So, the root cause seems to be a problem with VeliovGroup/Meteor-Cookies here.
(By the way: should we file the issue over there?!)

Would be great if you could have look into this issue?

Thanks for all your great work!
We hobe you have a clue what's going on here...

Thanks in advance.
Wolfram.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions