2

I am attempting to write a Firefox extension which downloads files. The website that I'm trying to download the files from requires cookies to be passed to GET requests, otherwise a 403 is returned. I can visit the URL that I'm attempting to download the file from in the browser, and the file will load correctly, indicating that my cookies are correct.

I can also, using my extension, issue GET requests to an authenticated-only API from the same domain and receive the correct response (indicating that cookies are passed correctly).

However, when I attempt to download a file from a url using Firefox's downloads API (browser.downloads.download), the download fails (I get a 403), because the cookies aren't being passed. I have confirmed this with Charles Proxy.

The Mozilla Documentation says "If the specified url uses the HTTP or HTTPS protocol, then the request will include all cookies currently set for its hostname"; my url uses HTTP.

Why aren't the cookies being passed?

I'm using Firefox Developer Edition (68.0).

1 Answers1

0

It was a Firefox bug in versions 67-69. https://bugzilla.mozilla.org/show_bug.cgi?id=1555591