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:
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.
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 beingbytes, bytes
, and then:https://github.com/barneygale/httpio/blob/18c1b98e3b36156477124139afa234800fc24634/httpio/__init__.py#L70
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.3Here's an url you can try for reproduction https://files.pythonhosted.org/packages/44/e8/4ae9ef3d455f4ce5aa22259cb6e40c69b29ef6b02d49c5cdfa265f7fc821/Django-3.0.1.tar.gz