Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incorrect content-encoding on gzip files. #23

Open
philipdouglas opened this issue Feb 24, 2014 · 1 comment
Open

Incorrect content-encoding on gzip files. #23

philipdouglas opened this issue Feb 24, 2014 · 1 comment

Comments

@philipdouglas
Copy link

If you try to use sendfile with .gz or .tgz files, the response is given the Content-Encoding of "gzip" which causes the browser (or other client) to automatically decompress it on download.

.gz files should have no content-encoding and a content-type of 'application/x-gzip' and .tgz files should have no content-encoding and a content-type of 'application/x-compressed ', I think.

@johnsensible
Copy link
Owner

I'm using:

from mimetypes import guess_type

to figure out the content-type of the file.

I think you can use that module to insert the content type you want:

https://docs.python.org/2/library/mimetypes.html#mimetypes.add_type

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants