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

416 Range Not Satisfiable if requested range end > file size #1588

Closed
jkmnt opened this issue Feb 6, 2017 · 3 comments
Closed

416 Range Not Satisfiable if requested range end > file size #1588

jkmnt opened this issue Feb 6, 2017 · 3 comments
Labels

Comments

@jkmnt
Copy link

jkmnt commented Feb 6, 2017

Long story short

static content:
aiohttp responses with 416 Range Not Satisfiable if requested range end > file size

Expected behaviour

range end is trimmed to the file end as per RFC7233 and 206 Partial Content is returned:
" ... If the last-byte-pos value is absent, or if the value is greater than or equal to the current
length of the representation data, the byte range is interpreted as the remainder of the
representation (i.e., the server replaces the value of last-byte-pos with a value that is one
less than the current length of the selected representation)."

Actual behaviour

416 Range Not Satisfiable returned

Steps to reproduce

Serve small static file (say, 1000 bytes), issue range request with the field 'Range: bytes=0-32767', observe 416 response

Your environment

aiohttp 1.2.0

@fafhrd91
Copy link
Member

fafhrd91 commented Feb 7, 2017

original implementation #1382

@fafhrd91
Copy link
Member

fafhrd91 commented Feb 7, 2017

good catch!

fixed in master

@fafhrd91 fafhrd91 closed this as completed Feb 7, 2017
@lock
Copy link

lock bot commented Oct 29, 2019

This thread has been automatically locked since there has not been
any recent activity after it was closed. Please open a new issue for
related bugs.

If you feel like there's important points made in this discussion,
please include those exceprts into that new issue.

@lock lock bot added the outdated label Oct 29, 2019
@lock lock bot locked as resolved and limited conversation to collaborators Oct 29, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants