From b9c63b0aae7a7f9ddf32e155b11a51bd9c441857 Mon Sep 17 00:00:00 2001 From: Terence Sun Date: Sat, 31 Jan 2015 19:15:42 -0800 Subject: Explicitly ignored wildcard verbs from head_routes In match_head_routes, deleted the routes in which request.request_method was empty (matches all HTTP verbs) when responding to a HEAD request. This prevents catch-all routes (such as Racks) from intercepting the HEAD request. Fixes #18698 --- actionpack/test/dispatch/routing_test.rb | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'actionpack/test/dispatch/routing_test.rb') diff --git a/actionpack/test/dispatch/routing_test.rb b/actionpack/test/dispatch/routing_test.rb index 3a95a9025f..ca5de05814 100644 --- a/actionpack/test/dispatch/routing_test.rb +++ b/actionpack/test/dispatch/routing_test.rb @@ -3477,6 +3477,18 @@ class TestRoutingMapper < ActionDispatch::IntegrationTest assert_equal '/post/comments/new', new_comment_path end + def test_head_fetch_with_mount_on_root + draw do + get '/home' => 'test#index' + mount lambda { |env| [404, {"Content-Type" => "text/html"}, ["testing"]] }, at: '/' + end + head '/home' + assert_response :success + + head '/' + assert_response :not_found + end + private def draw(&block) -- cgit v1.2.3