diff options
author | Jeremy Evans <code@jeremyevans.net> | 2020-07-15 08:38:44 -0700 |
---|---|---|
committer | Hiroshi SHIBATA <hsbt@ruby-lang.org> | 2020-09-24 21:34:07 +0900 |
commit | ed12019ce6abe87aac87ec77ac081d37b25180a2 (patch) | |
tree | ec2dd9fedab4f951fcf3483760adac5fd92ef5a2 /lib | |
parent | 0fe6461148af5f27c2a89a6bb25b6709b9eaca49 (diff) | |
download | ruby-ed12019ce6abe87aac87ec77ac081d37b25180a2.tar.gz |
[ruby/webrick] Allow empty POST and PUT requests without content length
RFC 7230 section 3.3.3 allows for this.
Fixes #30
https://github.com/ruby/webrick/commit/069e9b1908
Diffstat (limited to 'lib')
-rw-r--r-- | lib/webrick/httprequest.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/webrick/httprequest.rb b/lib/webrick/httprequest.rb index c781797092..294bd91a87 100644 --- a/lib/webrick/httprequest.rb +++ b/lib/webrick/httprequest.rb @@ -522,7 +522,7 @@ module WEBrick if @remaining_size > 0 && @socket.eof? raise HTTPStatus::BadRequest, "invalid body size." end - elsif BODY_CONTAINABLE_METHODS.member?(@request_method) + elsif BODY_CONTAINABLE_METHODS.member?(@request_method) && !@socket.eof raise HTTPStatus::LengthRequired end return @body |