content_range()
public
Returns a Range object which represents
Content-Range: header field. This indicates, for a partial entity body,
where this fragment fits inside the full entity body, as range of byte offsets.
Show source
def content_range
return nil unless @header['content-range']
m = %<bytes\s+(\d+)-(\d+)/(\d+|\*)>.match(self['Content-Range']) or
raise HTTPHeaderSyntaxError, 'wrong Content-Range format'
m[1].to_i .. m[2].to_i
end