Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add specs for underscore in host #2072

Merged
merged 1 commit into from
Apr 25, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
9 changes: 9 additions & 0 deletions test/spec_request.rb
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,11 @@ class RackRequestTest < Minitest::Spec
req.host.must_be_nil
req.hostname.must_be_nil

req = make_request \
Rack::MockRequest.env_for("/", "HTTP_HOST" => "some_service:3001")
req.host.must_equal "some_service"
req.hostname.must_equal "some_service"

req = make_request \
Rack::MockRequest.env_for("/", "SERVER_NAME" => "example.org", "SERVER_PORT" => "9292")
req.host.must_equal "example.org"
Expand Down Expand Up @@ -303,6 +308,10 @@ class RackRequestTest < Minitest::Spec
Rack::MockRequest.env_for("/", "HTTP_HOST" => "www2.example.org:81")
req.port.must_equal 81

req = make_request \
Rack::MockRequest.env_for("/", "HTTP_HOST" => "some_service:3001")
req.port.must_equal 3001

req = make_request \
Rack::MockRequest.env_for("/", "SERVER_NAME" => "example.org", "SERVER_PORT" => "9292")
req.port.must_equal 9292
Expand Down