Skip to content

Commit 417be8a

Browse files
mrhoribuclaude
authored andcommitted
Guard Net::HTTPHeader#content_length spec by net-http version
Strict Content-Length parsing came with net-http 0.10.0, not with a Ruby version: Ruby 4.0.x ships net-http 0.9.1 by default, but updating the gem on it brings the strict behavior. Guard on Net::HTTP::VERSION instead. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
1 parent 0816047 commit 417be8a

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

‎library/net-http/httpheader/content_length_spec.rb‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
@headers.content_length.should.eql?(123)
2222
end
2323

24-
ruby_version_is ""..."4.1" do
24+
version_is Net::HTTP::VERSION, ""..."0.10.0" do
2525
it "ignores the parts of the 'Content-Length' header entry around the digits" do
2626
@headers["Content-Length"] = "123valid"
2727
@headers.content_length.should.eql?(123)
@@ -31,7 +31,7 @@
3131
end
3232
end
3333

34-
ruby_version_is "4.1" do
34+
version_is Net::HTTP::VERSION, "0.10.0" do
3535
it "raises a Net::HTTPHeaderSyntaxError if the 'Content-Length' header entry is not entirely digits" do
3636
@headers["Content-Length"] = "123valid"
3737
-> { @headers.content_length }.should.raise(Net::HTTPHeaderSyntaxError)

0 commit comments

Comments
 (0)