jscher2000 / Content-Type-Fixer-extension

Firefox extension to override dumb Content-Type headers with correct values
Mozilla Public License 2.0
24 stars 2 forks source link

error in content type fixer #10

Closed lazymonkey2 closed 3 years ago

lazymonkey2 commented 3 years ago

Hello, I'm using your extension Content-Type Fixer version 1.7.2, on firefox 88.0.1 and Windows10.

I sometimes get a strange error: I load a page and it is shown a popup asking to save an html file. It seems random, sometimes the page loads correctly (without save dialog) and sometimes it doesn't (it shows save dialog).

See these screenshots:

immagine

immagine

And these are the options I set in the extension:

immagine

jscher2000 commented 3 years ago

Hmm, I don't know why that is happening. Could you check the Log (click Add/Edit Content Types (View Log)) and see what is listed for that request. Normally for HTML it would just say something along the following lines:

C-T: No Action - no association for extension; current CT is "text/html; charset=utf-8"

For files forced to download, it usually looks more like this:

C-T: No Action - CT already set to "application/pdf"
C-D: Forced to attachment

But you have kept the default exception for HTML so I wonder if the Content-Type is written in a way the extension is not parsing correctly. Thanks.

lazymonkey2 commented 3 years ago

Hi, thank for your reply. I looked into the log and found this:

immagine

jscher2000 commented 3 years ago

Uh-oh, the extension modified a redirect. I didn't realize that was a possibility. Let me try disabling that.

jscher2000 commented 3 years ago

Actually, I misread that. 304 is a code returned when Firefox is checking the freshness of a cached file and the server is indicating that it's okay to use the cached file. But either way, the problem is that the server isn't indicating the content type is text/html so the exception for HTML pages is not working.

I'm uploading version 1.7.3 which will limit content disposition changes to responses with the status code 200. Hopefully that won't break anyone's workflow, but I guess I'll find out!

lazymonkey2 commented 3 years ago

thank you for the updated release. I installed it and I'll report back here if my issue is fixed.

lazymonkey2 commented 3 years ago

hello, my issue seems fixed. thank you.