Why does my browser attempt to download pages from http://clhs.lisp.se instead of viewing them normally?

This problem started a few weeks ago.

Whenever I navigate to any page at http://clhs.lisp.se — for example this one: http://clhs.lisp.se/Body/m_w_open.htm — my browser doesn't display the page normally, but instead attempts to download the page as an HTML file.

This happens in Chrome, Firefox, Brave, Vivaldi and Opera; but not in Internet Explorer or Edge. It used to work fine in all browsers.

Why does it happen, and how can I make it work normally? Using IE or Edge is not an option.


There is something wrong with the way that website and/or web sever is delivering web pages.

This is not a problem on your end but rather something odd on the server side; with either the website itself or the server delivering web content.

Instead of delivering content with headers that indicate text/html it is delivering content as application/octet-stream which a web browser will interpret as being binary data that should then be handled as a file download. Look at the output of this Curl command:

curl -ILk http://clhs.lisp.se/Body/m_w_open.htm
HTTP/1.1 200 OK
Content-Type: application/octet-stream
Accept-Ranges: bytes
Content-Length: 8896
Date: Sat, 21 Sep 2019 18:41:10 GMT
Server: lighttpd/1.4.45

I’m pretty sure you can’t fix that on the client side unless there is some kind of plugin — for Firefox or Chrome for example — that will allow you to force specific headers for a we request like this.

That said, the core content of that site is available elsewhere on the Internet on sites that are properly configured and working as expected.

Past that, if you simply want to read the content on that site — rather than debug the issue on that site itself — you can access the same content at the following other sites as per dave_thompson_085’s comment to the question:

  • http://www.lispworks.com/documentation/lw50/CLHS/Front/index.htm
  • http://www.ai.mit.edu/projects/iiip/doc/CommonLISP/HyperSpec/FrontMatter/

And as per Dave’s comment, that second MIT link should be authoritative since, “IMHO the proper home; I knew Kent at the time he worked there.”


This funny website return for your page an answer with the following headers:

HTTP/1.1 200 OK
Content-Type: application/octet-stream
Accept-Ranges: bytes
Content-Length: 8896
Date: Sat, 21 Sep 2019 18:44:55 GMT
Server: lighttpd/1.4.45

The problem here is the Content-Type field, described as:

application

some other kind of data, typically either uninterpreted binary data or information to be processed by a mail-based application. The primary subtype, "octet-stream", is to be used in the case of uninterpreted binary data, in which case the simplest recommended action is to offer to write the information into a file for the user.

A binary file cannot be displayed by the browser. As the Content-Type value of "application/octet-stream" defines the return answer as a binary file, a browser that obeys the standard has no other possible action than to download the file.

IE and Edge were never that good at following the standards, which is why Microsoft is currently ditching both.


You can try ModHeader. After install you visit the root of the site, click on the extension icon, then on the plus sign, response header and type Content-Type. Happy browsing of that site.

You can use profiles inside the extension, to switch only when needed. If you create a profile without any rules, the icon will show as inactive, that would be the profile for the rest of the internet.

I tested it and it works, but be careful, there is no source code I can see and to modify headers you need full permissions on all pages. You can also enable/disable it from Firefox add-on manager, as needed. More info can be found here.