Skip to content

Commit

Permalink
Remove Rack::HTTP_VERSION and don't set HTTP_VERSION in env in cgi an…
Browse files Browse the repository at this point in the history
…d webrick

Fixes #970
  • Loading branch information
jeremyevans committed Jul 14, 2020
1 parent a12c4a8 commit 5791ef6
Show file tree
Hide file tree
Showing 5 changed files with 1 addition and 4 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Expand Up @@ -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

Expand Down
1 change: 0 additions & 1 deletion lib/rack.rb
Expand Up @@ -16,7 +16,6 @@
module Rack
HTTP_HOST = 'HTTP_HOST'
HTTP_PORT = 'HTTP_PORT'
HTTP_VERSION = 'HTTP_VERSION'
HTTPS = 'HTTPS'
PATH_INFO = 'PATH_INFO'
REQUEST_METHOD = 'REQUEST_METHOD'
Expand Down
1 change: 0 additions & 1 deletion lib/rack/handler/cgi.rb
Expand Up @@ -25,7 +25,6 @@ def self.serve(app)
)

env[QUERY_STRING] ||= ""
env[HTTP_VERSION] ||= env[SERVER_PROTOCOL]
env[REQUEST_PATH] ||= "/"

status, headers, body = app.call(env)
Expand Down
1 change: 0 additions & 1 deletion lib/rack/handler/webrick.rb
Expand Up @@ -84,7 +84,6 @@ def service(req, res)
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
Expand Down
1 change: 0 additions & 1 deletion test/spec_webrick.rb
Expand Up @@ -42,7 +42,6 @@ def is_running?
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"
Expand Down

0 comments on commit 5791ef6

Please sign in to comment.