diff options
author | Nobuyoshi Nakada <nobu@ruby-lang.org> | 2022-06-16 22:10:59 +0900 |
---|---|---|
committer | Nobuyoshi Nakada <nobu@ruby-lang.org> | 2022-06-16 22:10:59 +0900 |
commit | 2223eb082afa6d05321b69df783d4133b9aacba6 (patch) | |
tree | 97a9ca8e1bba00d14efdce482941eb0656818cea /lib | |
parent | 1cc64a5514309920c48874bbccc87102b69c2abf (diff) | |
download | ruby-2223eb082afa6d05321b69df783d4133b9aacba6.tar.gz |
Revert "HTTPHeader.content_range throws error on non-byte units"
This reverts commit 63546bfc1581d4abec2a0d846106a1c0afc0efa9.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/net/http/header.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/net/http/header.rb b/lib/net/http/header.rb index e96d62732a..a8901e79cb 100644 --- a/lib/net/http/header.rb +++ b/lib/net/http/header.rb @@ -338,8 +338,8 @@ module Net::HTTPHeader # fits inside the full entity body, as range of byte offsets. def content_range return nil unless @header['content-range'] - m = %r<bytes\s+(\d+)-(\d+)/(\d+|\*)>i.match(self['Content-Range']) - return nil if m.nil? + m = %r<bytes\s+(\d+)-(\d+)/(\d+|\*)>i.match(self['Content-Range']) or + raise Net::HTTPHeaderSyntaxError, 'wrong Content-Range format' m[1].to_i .. m[2].to_i end |