diff options
author | bptato <nincsnevem662@gmail.com> | 2024-03-16 20:11:53 +0100 |
---|---|---|
committer | bptato <nincsnevem662@gmail.com> | 2024-03-16 20:17:01 +0100 |
commit | 9aa8e20bd5552916c6b382659224f1003b02dbc7 (patch) | |
tree | 95c39447d43e14a8435a25f83ecd76a012a94678 /src/local | |
parent | 5b330ef56e50ad454712a77f805377b41dfb140b (diff) | |
download | chawan-9aa8e20bd5552916c6b382659224f1003b02dbc7.tar.gz |
container: fall back to text/plain instead of application/octet-stream
This has its own problems, but application/octet-stream has the horrible consequence that opening any local file with an unrecognized type automatically quits the browser. (FWIW, w3m also falls back to text/plain, so it's not such an unreasonable default.) The proper solution would be to a) fix the bug that makes the browser auto-quit and b) show a "what to do" prompt for unrecognized file types (and allow users to override it, preferably on a per-protocol basis.)
Diffstat (limited to 'src/local')
-rw-r--r-- | src/local/container.nim | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/local/container.nim b/src/local/container.nim index 011c7279..62799c56 100644 --- a/src/local/container.nim +++ b/src/local/container.nim @@ -1412,7 +1412,8 @@ proc applyResponse*(container: Container; response: Response; if container.contentType.isNone: var contentType = response.getContentType() if contentType == "application/octet-stream": - contentType = mimeTypes.guessContentType(container.url.pathname) + contentType = mimeTypes.guessContentType(container.url.pathname, + "text/plain") container.contentType = some(contentType) # setup charsets: # * override charset |