Skip to content
This repository was archived by the owner on Sep 13, 2024. It is now read-only.
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions uwsgi/spockfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ static int spockfs_get(struct wsgi_request *wsgi_req, char *path) {

size_t fsize = st.st_size;
// security check
if (wsgi_req->range_from > fsize) {
if (wsgi_req->range_from >= fsize) {
wsgi_req->range_from = 0;
wsgi_req->range_to = 0;
}
Expand All @@ -141,7 +141,7 @@ static int spockfs_get(struct wsgi_request *wsgi_req, char *path) {
fsize = st.st_size - wsgi_req->range_from;
}
if (uwsgi_response_prepare_headers(wsgi_req, "206 Partial Content", 19)) goto end;
if (uwsgi_response_add_content_range(wsgi_req, wsgi_req->range_from, wsgi_req->range_to, st.st_size)) goto end;
if (uwsgi_response_add_content_range(wsgi_req, wsgi_req->range_from, wsgi_req->range_from + fsize - 1, st.st_size)) goto end;
}
else {
if (uwsgi_response_prepare_headers(wsgi_req, "200 OK", 6)) goto end;
Expand Down