diff options
author | Matthew Draper <matthew@trebex.net> | 2016-07-14 10:41:02 +0930 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-07-14 10:41:02 +0930 |
commit | a1ac08c2d9646e145d8f8f9734faa9a1d1f8ebbe (patch) | |
tree | 35b2d5385704fbf970daf3b882b3b9883d895ed7 /actionpack/test/dispatch | |
parent | 853a041d5eab1afc8f08e7bb8bf6425cca95f6d3 (diff) | |
parent | 25c1461766745259d1d5be10fdcddc6e56d24f22 (diff) | |
download | rails-a1ac08c2d9646e145d8f8f9734faa9a1d1f8ebbe.tar.gz rails-a1ac08c2d9646e145d8f8f9734faa9a1d1f8ebbe.tar.bz2 rails-a1ac08c2d9646e145d8f8f9734faa9a1d1f8ebbe.zip |
Merge pull request #25798 from greysteil/dont-raise-unknown-http-method-low-in-stack
Don't raise ActionController::UnknownHttpMethod from ActionDispatch::Static
Diffstat (limited to 'actionpack/test/dispatch')
-rw-r--r-- | actionpack/test/dispatch/static_test.rb | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/actionpack/test/dispatch/static_test.rb b/actionpack/test/dispatch/static_test.rb index ea8b5e904e..1036758f35 100644 --- a/actionpack/test/dispatch/static_test.rb +++ b/actionpack/test/dispatch/static_test.rb @@ -160,6 +160,9 @@ module StaticTests response = get(file_name, 'HTTP_ACCEPT_ENCODING' => 'GZIP') assert_gzip file_name, response + response = get(file_name, 'HTTP_ACCEPT_ENCODING' => 'compress;q=0.5, gzip;q=1.0') + assert_gzip file_name, response + response = get(file_name, 'HTTP_ACCEPT_ENCODING' => '') assert_not_equal 'gzip', response.headers["Content-Encoding"] end @@ -205,6 +208,12 @@ module StaticTests assert_equal "I'm a teapot", response.headers["X-Custom-Header"] end + def test_ignores_unknown_http_methods + app = ActionDispatch::Static.new(DummyApp, @root) + + assert_nothing_raised { Rack::MockRequest.new(app).request("BAD_METHOD", "/foo/bar.html") } + end + # Windows doesn't allow \ / : * ? " < > | in filenames unless RbConfig::CONFIG['host_os'] =~ /mswin|mingw/ def test_serves_static_file_with_colon |