Skip to content

Commit

Permalink
Return correct content-range header
Browse files Browse the repository at this point in the history
According to the HTTP spec, the response from a "Range" request should have a
"content-range" header in the form of "range_begin-range_end/doc_length". But
xrootd currently returns the length of the range intead of the range of the whole
file. Pass in the length of the file and additionally change the printf string since the
file size is stored in a long long
  • Loading branch information
PerilousApricot committed Dec 12, 2018
1 parent 8e54ed5 commit b32eb30
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/XrdHttp/XrdHttpReq.cc
Expand Up @@ -1925,7 +1925,7 @@ int XrdHttpReq::PostProcessHTTPReq(bool final_) {
char buf[64];

XrdOucString s = "Content-Range: bytes ";
sprintf(buf, "%lld-%lld/%d", rwOps[0].bytestart, rwOps[0].byteend, cnt);
sprintf(buf, "%lld-%lld/%lld", rwOps[0].bytestart, rwOps[0].byteend, filesize);
s += buf;


Expand Down

0 comments on commit b32eb30

Please sign in to comment.