summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornagachika <nagachika@ruby-lang.org>2020-09-29 13:46:14 (GMT)
committernagachika <nagachika@ruby-lang.org>2020-09-29 13:46:14 (GMT)
commit828c34e58b63d64558ec0f2d1d7ae401c5e6b21f (patch)
treef201b59c6d6c5f789cf2c26afa28a409e113293b
parentdf3f52a6331f1a47af9933b77311a8650727d8d1 (diff)
merge revision(s) d23d2f3f6fbb5d787b0dd80675c489a692be23e2:
[ruby/webrick] Make it more strict to interpret some headers Some regexps were too tolerant. https://github.com/ruby/webrick/commit/8946bb38b4
-rw-r--r--lib/webrick/httprequest.rb6
-rw-r--r--version.h2
2 files changed, 4 insertions, 4 deletions
diff --git a/lib/webrick/httprequest.rb b/lib/webrick/httprequest.rb
index 87dc879..6af0cee 100644
--- a/lib/webrick/httprequest.rb
+++ b/lib/webrick/httprequest.rb
@@ -226,9 +226,9 @@ module WEBrick
raise HTTPStatus::BadRequest, "bad URI `#{@unparsed_uri}'."
end
- if /close/io =~ self["connection"]
+ if /\Aclose\z/io =~ self["connection"]
@keep_alive = false
- elsif /keep-alive/io =~ self["connection"]
+ elsif /\Akeep-alive\z/io =~ self["connection"]
@keep_alive = true
elsif @http_version < "1.1"
@keep_alive = false
@@ -503,7 +503,7 @@ module WEBrick
return unless socket
if tc = self['transfer-encoding']
case tc
- when /chunked/io then read_chunked(socket, block)
+ when /\Achunked\z/io then read_chunked(socket, block)
else raise HTTPStatus::NotImplemented, "Transfer-Encoding: #{tc}."
end
elsif self['content-length'] || @remaining_size
diff --git a/version.h b/version.h
index 7f0007e..d578e36 100644
--- a/version.h
+++ b/version.h
@@ -2,7 +2,7 @@
# define RUBY_VERSION_MINOR RUBY_API_VERSION_MINOR
#define RUBY_VERSION_TEENY 1
#define RUBY_RELEASE_DATE RUBY_RELEASE_YEAR_STR"-"RUBY_RELEASE_MONTH_STR"-"RUBY_RELEASE_DAY_STR
-#define RUBY_PATCHLEVEL 130
+#define RUBY_PATCHLEVEL 131
#define RUBY_RELEASE_YEAR 2020
#define RUBY_RELEASE_MONTH 9