1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* lib/net/http.rb (Net::HTTPHeader#{content_range,range_length}):

use inclusive range same as the header representation.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26344 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nobu 2010-01-18 06:49:46 +00:00
parent 5ed5439af4
commit 67244d1a70
2 changed files with 7 additions and 2 deletions

View file

@ -1,3 +1,8 @@
Mon Jan 18 15:49:42 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
* lib/net/http.rb (Net::HTTPHeader#{content_range,range_length}):
use inclusive range same as the header representation.
Mon Jan 18 03:59:57 2010 Akinori MUSHA <knu@iDaemons.org>
* ext/digest/digest.c (rb_digest_instance_hexdigest_bang): Fix

View file

@ -1520,13 +1520,13 @@ module Net #:nodoc:
return nil unless @header['content-range']
m = %r<bytes\s+(\d+)-(\d+)/(\d+|\*)>i.match(self['Content-Range']) or
raise HTTPHeaderSyntaxError, 'wrong Content-Range format'
m[1].to_i .. m[2].to_i + 1
m[1].to_i .. m[2].to_i
end
# The length of the range represented in Content-Range: header.
def range_length
r = content_range() or return nil
r.end - r.begin
r.end - r.begin + 1
end
# Returns a content type string such as "text/html".