summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authornaruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-07-21 08:27:08 +0000
committernaruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-07-21 08:27:08 +0000
commit2dfc9e162615a326eb639bd51ce0ae9ec3d439e4 (patch)
treeb2bacd3f3715aa726d7c46404e5c803ddfc46c2f /lib
parent4aa9e1ace0c240a99bd41b59a3df736948198480 (diff)
* lib/webrick/httprequest.rb (WEBrick::HTTPRequest#each):
Allow HTTP/0.9 request which doesn't has any header or body. patched by Felix Jodoin. [ruby-core:38040] [Bug #5022] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32593 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib')
-rw-r--r--lib/webrick/httprequest.rb10
1 files changed, 6 insertions, 4 deletions
diff --git a/lib/webrick/httprequest.rb b/lib/webrick/httprequest.rb
index 1e8789d2d6..050b5ed45b 100644
--- a/lib/webrick/httprequest.rb
+++ b/lib/webrick/httprequest.rb
@@ -179,10 +179,12 @@ module WEBrick
# Iterates over the request headers
def each
- @header.each{|k, v|
- value = @header[k]
- yield(k, value.empty? ? nil : value.join(", "))
- }
+ if @header
+ @header.each{|k, v|
+ value = @header[k]
+ yield(k, value.empty? ? nil : value.join(", "))
+ }
+ end
end
##