diff options
author | Eric Wong <e@80x24.org> | 2014-05-25 04:40:20 +0000 |
---|---|---|
committer | Eric Wong <e@80x24.org> | 2014-05-29 20:12:04 +0000 |
commit | 5bd61b57d63ae86fc246531d3a483c15ee0dcd57 (patch) | |
tree | 9810d265992167770f426a25c003ed362cc25771 /test | |
parent | 9f72638e08d7d08eadffe6b0299205b6620f250e (diff) | |
download | unicorn-5bd61b57d63ae86fc246531d3a483c15ee0dcd57.tar.gz |
This has long been considered a mistake and not documented for very long. I considered removing X-Forwarded-Proto and X-Forwarded-SSL handling, too, so rack.url_scheme is always "http", but that might lead to compatibility issues in rare apps if Rack::Request#scheme is not used.
Diffstat (limited to 'test')
-rw-r--r-- | test/unit/test_http_parser_xftrust.rb | 38 |
1 files changed, 0 insertions, 38 deletions
diff --git a/test/unit/test_http_parser_xftrust.rb b/test/unit/test_http_parser_xftrust.rb deleted file mode 100644 index db8cfa9..0000000 --- a/test/unit/test_http_parser_xftrust.rb +++ /dev/null @@ -1,38 +0,0 @@ -# -*- encoding: binary -*- -require 'test/test_helper' - -include Unicorn - -class HttpParserXFTrustTest < Test::Unit::TestCase - def setup - assert HttpParser.trust_x_forwarded? - end - - def test_xf_trust_false_xfp - HttpParser.trust_x_forwarded = false - parser = HttpParser.new - parser.buf << "GET / HTTP/1.1\r\nHost: foo:\r\n" \ - "X-Forwarded-Proto: https\r\n\r\n" - env = parser.parse - assert_kind_of Hash, env - assert_equal 'foo', env['SERVER_NAME'] - assert_equal '80', env['SERVER_PORT'] - assert_equal 'http', env['rack.url_scheme'] - end - - def test_xf_trust_false_xfs - HttpParser.trust_x_forwarded = false - parser = HttpParser.new - parser.buf << "GET / HTTP/1.1\r\nHost: foo:\r\n" \ - "X-Forwarded-SSL: on\r\n\r\n" - env = parser.parse - assert_kind_of Hash, env - assert_equal 'foo', env['SERVER_NAME'] - assert_equal '80', env['SERVER_PORT'] - assert_equal 'http', env['rack.url_scheme'] - end - - def teardown - HttpParser.trust_x_forwarded = true - end -end |