-
-
Notifications
You must be signed in to change notification settings - Fork 146
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
Requesting range off end of file does not return 416 status code #281
Comments
I did have a quick look at the code and the error occurs in I did get the simple case to work by adding a check for |
Yes, I also looked into it a bit yesterday. As I understand it, invalid Range headers may result in a
I will try to get the latter working. (Multi-Part responses are currently not implemented btw.) |
commit aa6d498 Author: Martin Wendt <github@wwwendt.de> Date: Tue Apr 11 22:09:58 2023 +0200 Fix: Requesting range off end of file does not return 416 status code Close mar10#281 commit 1fdb68f Author: Martin Wendt <github@wwwendt.de> Date: Mon Apr 10 19:16:06 2023 +0200 Snake-cased some vars commit 5f259c2 Author: Martin Wendt <github@wwwendt.de> Date: Mon Apr 10 17:59:26 2023 +0200 Install pam_dc dependencies using extra syntax: `pip install wsgidav[pam]`
* Hotfix PUT request without content-length MacOS Ventura behaviour is now similar to MS Windows * tox -e format * New option hotfixes. accept_put_without_content_length * Squashed commit of the following: commit aa6d498 Author: Martin Wendt <github@wwwendt.de> Date: Tue Apr 11 22:09:58 2023 +0200 Fix: Requesting range off end of file does not return 416 status code Close #281 commit 1fdb68f Author: Martin Wendt <github@wwwendt.de> Date: Mon Apr 10 19:16:06 2023 +0200 Snake-cased some vars commit 5f259c2 Author: Martin Wendt <github@wwwendt.de> Date: Mon Apr 10 17:59:26 2023 +0200 Install pam_dc dependencies using extra syntax: `pip install wsgidav[pam]` --------- Co-authored-by: Martin Wendt <github@wwwendt.de>
Describe the bug
If we request a byte range that is beyond the end of the file the server returns the full content of the file and ignores the byte range.
To Reproduce
Steps to reproduce the behavior:
Run up a server with a small file in it:
(I have tried cheroot and uvicorn servers)
Use curl to request content:
This works:
Ask for a byte range that crosses the threshold and this works:
Now ask for a byte range that starts off the end of the file and this fails:
The entire file is returned as shown by the
Content-Range
header.The server is receiving the request properly:
Expected behavior
The expectation is that this should return status code 416. It should definitely not return the full content of the file.
For example requesting a file from GitHub:
Screenshots, Log-Files, Stacktrace
If applicable, add screenshots to help explain your problem.
If applicable, add a log file (consider
--verbose
).Environment:
Which WSGI server was used (cheroot, ext-wsgiutils, gevent, gunicorn, paste, uvicorn, wsgiref, ...)?
cheroot and uvicorn.
Which WebDAV client was used (MS File Explorer, MS Office, macOS Finder, WinSCP, Windows, file mapping, ...)?
Simple curl.
The text was updated successfully, but these errors were encountered: