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

Add accept header for permit all MIME types #282

Merged
merged 1 commit into from
Nov 12, 2020
Merged

Add accept header for permit all MIME types #282

merged 1 commit into from
Nov 12, 2020

Conversation

UesleyCarossi
Copy link
Contributor

In some cases when trying to request the image url, the host returned HTTP Error 403: Forbidden, as this error is not dealt with right away, the BytesIO constructor is called with an invalid value, returning a blank byte sequence , then this sequence is passed to the PIL.Image.open() function, raise the exception PIL.UnidentifiedImageError.

An acceptance header has been added to allow all MIME types, resolving cases of hosts that it is mandatory to define content types.

@RafaelWerner
Copy link

Amazing!!

image

Copy link
Owner

@jantic jantic left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very helpful and appreciated. Works for me. Thank you!

@jantic jantic merged commit c872a02 into jantic:master Nov 12, 2020
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 this pull request may close these issues.

3 participants