summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeremy Evans <code@jeremyevans.net>2020-07-14 11:11:35 -0700
committerJeremy Evans <code@jeremyevans.net>2020-07-14 11:50:36 -0700
commit5791ef617717d568dc3387cfd5db1c97f08455ca (patch)
tree7f5b50e5e40362995352b41f80e23f9044ce4222
parenta12c4a80938b1105213dded32a21205ae3293208 (diff)
downloadrack-5791ef617717d568dc3387cfd5db1c97f08455ca.tar.gz
Remove Rack::HTTP_VERSION and don't set HTTP_VERSION in env in cgi and webrick
Fixes #970
-rw-r--r--CHANGELOG.md1
-rw-r--r--lib/rack.rb1
-rw-r--r--lib/rack/handler/cgi.rb1
-rw-r--r--lib/rack/handler/webrick.rb1
-rw-r--r--test/spec_webrick.rb1
5 files changed, 1 insertions, 4 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 6f024e74..427ec797 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -11,6 +11,7 @@ All notable changes to this project will be documented in this file. For info on
- Removed antiquated handlers: FCGI, LSWS, SCGI, Thin. ([#1658](https://github.com/rack/rack/pull/1658), [@ioquatix](https://github.com/ioquatix))
- Removed options from `Rack::Builder.parse_file` and `Rack::Builder.load_file`. ([#1663](https://github.com/rack/rack/pull/1663), [@ioquatix](https://github.com/ioquatix))
- HMAC argument for `Rack::Session::Cookie` doesn't accept a class constant anymore, but only a string recognized by OpenSSL (e.g. `"SHA256"`) or compatible instance (e.g. `OpenSSL::Digest.new("SHA256")`) ([#1676](https://github.com/rack/rack/pull/1676), [@bdewater](https://github.com/bdewater))
+- `Rack::HTTP_VERSION` has been removed and the `HTTP_VERSION` env setting is no longer set in the CGI and Webrick handlers . ([#970](https://github.com/rack/rack/issues/970), [@jeremyevans](https://github.com/jeremyevans))
### Fixed
diff --git a/lib/rack.rb b/lib/rack.rb
index e4494e5b..b931292e 100644
--- a/lib/rack.rb
+++ b/lib/rack.rb
@@ -16,7 +16,6 @@ require_relative 'rack/version'
module Rack
HTTP_HOST = 'HTTP_HOST'
HTTP_PORT = 'HTTP_PORT'
- HTTP_VERSION = 'HTTP_VERSION'
HTTPS = 'HTTPS'
PATH_INFO = 'PATH_INFO'
REQUEST_METHOD = 'REQUEST_METHOD'
diff --git a/lib/rack/handler/cgi.rb b/lib/rack/handler/cgi.rb
index 8a281849..b514fe74 100644
--- a/lib/rack/handler/cgi.rb
+++ b/lib/rack/handler/cgi.rb
@@ -25,7 +25,6 @@ module Rack
)
env[QUERY_STRING] ||= ""
- env[HTTP_VERSION] ||= env[SERVER_PROTOCOL]
env[REQUEST_PATH] ||= "/"
status, headers, body = app.call(env)
diff --git a/lib/rack/handler/webrick.rb b/lib/rack/handler/webrick.rb
index 1e88c195..07c7f9e0 100644
--- a/lib/rack/handler/webrick.rb
+++ b/lib/rack/handler/webrick.rb
@@ -84,7 +84,6 @@ module Rack
RACK_HIJACK_IO => nil
)
- env[HTTP_VERSION] ||= env[SERVER_PROTOCOL]
env[QUERY_STRING] ||= ""
unless env[PATH_INFO] == ""
path, n = req.request_uri.path, env[SCRIPT_NAME].length
diff --git a/test/spec_webrick.rb b/test/spec_webrick.rb
index 82f28911..b0bfa2b0 100644
--- a/test/spec_webrick.rb
+++ b/test/spec_webrick.rb
@@ -42,7 +42,6 @@ describe Rack::Handler::WEBrick do
GET("/test")
status.must_equal 200
response["SERVER_SOFTWARE"].must_match(/WEBrick/)
- response["HTTP_VERSION"].must_equal "HTTP/1.1"
response["SERVER_PROTOCOL"].must_equal "HTTP/1.1"
response["SERVER_PORT"].must_equal "9202"
response["SERVER_NAME"].must_equal "127.0.0.1"