Closed Bug 1495197 Opened 7 years ago Closed 7 years ago

With identical HTTP response headers, extension in the URL changes behavior

Categories

(Firefox :: Untriaged, defect)

62 Branch
defect
Not set
normal

Tracking

()

RESOLVED INVALID

People

(Reporter: ttsiodras, Unassigned)

Details

User Agent: Mozilla/5.0 (X11; Linux x86_64; rv:62.0) Gecko/20100101 Firefox/62.0 Build ID: 20180920131237 Steps to reproduce: After mirroring a website locally and serving it from a local nginx installation, I tried opening one of the URLs: https://ttsiodras.verymad.net/Eli.Bendersky/tag/serial-port Actual results: Firefox 62.0.2 replied with "You have chosen to open BIN file" and offered to save the content... Expected results: The response is of content-type/html - Firefox should have just displayed the content (as e.g. Chrome does), not offer to save it. Adding a symlink with an .html extension that points to the same file proves that this is valid HTML content - and Firefox shows this just fine: https://ttsiodras.verymad.net/Eli.Bendersky/tag/serial-port.html Note that both URLs in fact return the exact same response - including response headers: $ curl -I https://ttsiodras.verymad.net/Eli.Bendersky/tag/serial-port.html HTTP/1.1 200 OK Server: nginx Date: Sat, 29 Sep 2018 11:11:13 GMT Content-Type: text/html Content-Length: 5443 Last-Modified: Sat, 29 Sep 2018 10:36:17 GMT Connection: keep-alive ETag: "5baf55a1-1543" Accept-Ranges: bytes $ curl -I https://ttsiodras.verymad.net/Eli.Bendersky/tag/serial-port HTTP/1.1 200 OK Server: nginx Date: Sat, 29 Sep 2018 11:11:15 GMT Content-Type: text/html Content-Length: 5443 Last-Modified: Sat, 29 Sep 2018 10:36:17 GMT Connection: keep-alive ETag: "5baf55a1-1543" Accept-Ranges: bytes Why would Firefox be looking at the "file extension" instead of the content type to decide whether to render or save the content?
My bad - I had to clear the browser cache (it had stored a previous content-type).
Status: UNCONFIRMED → RESOLVED
Closed: 7 years ago
Resolution: --- → INVALID
You need to log in before you can comment on or make changes to this bug.