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

Normalize content-type before extention computation in SimpleHTTPResolver #508

Open
damooo opened this issue Aug 22, 2020 · 0 comments · May be fixed by #509
Open

Normalize content-type before extention computation in SimpleHTTPResolver #508

damooo opened this issue Aug 22, 2020 · 0 comments · May be fixed by #509

Comments

@damooo
Copy link

damooo commented Aug 22, 2020

in SimpleHTTPResolver, when we are saving fie to cache, we are computing file-extension from request's content-type header. this extension will be then used in computing source_format at time of resolving.

But it is not normalizing content-type before dictionary lookup. Thus it doesn't support values like image/jpeg; charset=UTF-8, (archive.org responds like that.). We have to normalize it to image/jpeg before dictionary lookup.

Here is the place in code:

extension = self.get_format(ident, constants.FORMATS_BY_MEDIA_TYPE[response.headers['content-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

Successfully merging a pull request may close this issue.

1 participant