diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/webrick/httprequest.rb | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/lib/webrick/httprequest.rb b/lib/webrick/httprequest.rb index 28be9fd790..75d26b529a 100644 --- a/lib/webrick/httprequest.rb +++ b/lib/webrick/httprequest.rb @@ -122,6 +122,15 @@ module WEBrick end end + # Generate HTTP/1.1 100 continue response if the client expects it, + # otherwise does nothing. + def continue + if self['expect'] == '100-continue' && @config[:HTTPVersion] >= "1.1" + @socket << "HTTP/#{@config[:HTTPVersion]} 100 continue#{CRLF}#{CRLF}" + @header.delete('expect') + end + end + def body(&block) block ||= Proc.new{|chunk| @body << chunk } read_body(@socket, block) |