summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorJeremy Evans <code@jeremyevans.net>2019-08-06 15:48:18 -0700
committerHiroshi SHIBATA <hsbt@ruby-lang.org>2019-10-24 19:47:10 +0900
commit37c266aa57fc2c6798a7b6002867643ef0424fa1 (patch)
tree99cd85e253bc58018e76369c86693f1a65c29265 /lib
parent84ed4c3d59a3317c6aff017e88f0ea897dbf8410 (diff)
[ruby/webrick] Remove the squishing of whitespace in header values
While the stripping of header values is required by RFC 2616 4.2 and RFC 7230 3.2.4, the squishing is not and can break things, such as when one header contains an HMAC of another header. Fixes Ruby Bug 7021. https://github.com/ruby/webrick/commit/8b96088a86
Diffstat (limited to 'lib')
-rw-r--r--lib/webrick/httputils.rb5
1 files changed, 1 insertions, 4 deletions
diff --git a/lib/webrick/httputils.rb b/lib/webrick/httputils.rb
index 3a2891900f..76d4bd0dc7 100644
--- a/lib/webrick/httputils.rb
+++ b/lib/webrick/httputils.rb
@@ -162,10 +162,7 @@ module WEBrick
end
}
header.each{|key, values|
- values.each{|value|
- value.strip!
- value.gsub!(/\s+/, " ")
- }
+ values.each(&:strip!)
}
header
end