diff options
| author | Jeremy Evans <code@jeremyevans.net> | 2020-01-16 17:39:28 -0800 |
|---|---|---|
| committer | Samuel Williams <samuel.williams@oriontransfer.co.nz> | 2020-01-18 09:42:42 +1300 |
| commit | 5b7e48e1e13d5df458d83855af60cb0498d836b3 (patch) | |
| tree | 8dae59e8f36a7c66dfc666a758c54389605fbbf4 /test | |
| parent | dfc8e020f43aa9397486d1a47529d500613af1dd (diff) | |
| download | rack-5b7e48e1e13d5df458d83855af60cb0498d836b3.tar.gz | |
Make Rack::Request#ssl? be true for wss scheme
wss is used for Websockets sent over a TLS connection, just as
https ised used for HTTP sent over a TLS connection.
Fixes #1020
Diffstat (limited to 'test')
| -rw-r--r-- | test/spec_request.rb | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/test/spec_request.rb b/test/spec_request.rb index 5f418ffd..cc262b55 100644 --- a/test/spec_request.rb +++ b/test/spec_request.rb @@ -574,6 +574,10 @@ class RackRequestTest < Minitest::Spec request.scheme.must_equal "https" request.must_be :ssl? + request = make_request(Rack::MockRequest.env_for("/", 'rack.url_scheme' => 'wss')) + request.scheme.must_equal "wss" + request.must_be :ssl? + request = make_request(Rack::MockRequest.env_for("/", 'HTTP_HOST' => 'www.example.org:8080')) request.scheme.must_equal "http" request.wont_be :ssl? |
