Problem: sending a content-type: application/octet-stream header for every file without a known extension often triggers a download of the file for a top-level navigation. Oftentimes those files are simple text files and could be served with a text/plain content type instead.
This PR implements the “7.2. Sniffing a mislabeled binary resource” algorithm from the MIME Sniffing Standard to try and detect if a file is a text or binary file.
Problem: sending a
content-type: application/octet-stream
header for every file without a known extension often triggers a download of the file for a top-level navigation. Oftentimes those files are simple text files and could be served with atext/plain
content type instead.This PR implements the “7.2. Sniffing a mislabeled binary resource” algorithm from the MIME Sniffing Standard to try and detect if a file is a text or binary file.