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

"httpio.HTTPIOError: Server does not accept 'Range' headers" when server does accept Range #6

Open
ewjoachim opened this issue Jan 12, 2020 · 0 comments

Comments

@ewjoachim
Copy link

ewjoachim commented Jan 12, 2020

For some reason, it seems AmazonS3 may return the "accept-ranges: bytes" header more than once. requests will concatenate the values, resulting in the header value being bytes, bytes, and then:

if response.headers.get('Accept-Ranges', '').lower() != 'bytes':

This test triggers, and we can't open the file.

I'd guess a better test would be "bytes" in response.headers.get(...)

Also, it looks like the Accept-Ranges header is not required:
https://tools.ietf.org/html/rfc7233#section-2.3

An origin server that supports byte-range requests for a given target
resource MAY send Accept-Ranges: bytes to indicate what range units are supported.

Here's an url you can try for reproduction
https://files.pythonhosted.org/packages/44/e8/4ae9ef3d455f4ce5aa22259cb6e40c69b29ef6b02d49c5cdfa265f7fc821/Django-3.0.1.tar.gz

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

1 participant