You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Range requests do not work when full content is smaller than the requested Range #604
When a GET request has a Range bigger than the actual content to be sent in the response, Restlet gives a wrong Content-Length header. The Content-Range header is correct.
Example HTTP Request:
GET /mm/A2LUIXJTVSN7YU HTTP/1.1
host: dummy.com
Accept: */*
Accept-Encoding: deflate, gzip
Range: bytes=0-40960
Connection: Close
HTTP/1.1 206 Partial Content
Accept-Ranges: bytes
Content-Range: bytes 0-40960/1569
Content-Type: text/html;charset=UTF-8
Date: Thu, 07 Jun 2012 18:41:19 GMT
Server: Restlet-Framework/2.0.9
Vary: Accept-Charset,Accept-Encoding,Accept-Language,Accept
Content-Length: 40961
Connection: Close
Issue was found while working with the facebook opengraph features. As facebook is using a Range request, it does not work if the opengraph object is served by a Restlet application.
I used getRangeService().setEnabled(false) as a workaround
Also, I don't know if it is facebook's HTTP implementation that is wrong: is it accepted to ask for a Range without first making a HEAD request to know the full Content-Length?
I think also this is a bug. Actually there are two bugs since the "Content-Length" is wrong and the "Content-Range" also (see RFC 2616 chapter 14.16 Content-Range : A byte-content-range-spec with a [...] instance-length value is less than or equal to its last-byte-pos value is invalid).
Activity
cmosa commentedon Jun 7, 2012
Issue was found while working with the facebook opengraph features. As facebook is using a Range request, it does not work if the opengraph object is served by a Restlet application.
I used
getRangeService().setEnabled(false)as a workaroundAlso, I don't know if it is facebook's HTTP implementation that is wrong: is it accepted to ask for a Range without first making a HEAD request to know the full Content-Length?
mintrigue commentedon Jun 14, 2012
I came across this same issue. I believe it is a bug in restlet because the content-length is supposed to be the length of the content being returned.
I think this can be fixed by updating BioUtil.getAvailableSize().
mintrigue commentedon Jun 14, 2012
I added a pull request for this...noted in issue #609
thboileau commentedon Jun 20, 2012
I think also this is a bug. Actually there are two bugs since the "Content-Length" is wrong and the "Content-Range" also (see RFC 2616 chapter 14.16 Content-Range : A byte-content-range-spec with a [...] instance-length value is less than or equal to its last-byte-pos value is invalid).
jlouvel commentedon Aug 18, 2012
Agreed, we need to fix both issues.