From 1ec85cf9d8a6ad36c3c40cc08a0c7d8407e4b080 Mon Sep 17 00:00:00 2001 From: eileencodes Date: Fri, 26 Aug 2016 13:12:33 -0400 Subject: Missing key should throw KeyError It should not throw a NameError, but should throw a KeyError. Fixes #26278 --- actionpack/lib/action_dispatch/http/headers.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'actionpack/lib/action_dispatch/http/headers.rb') diff --git a/actionpack/lib/action_dispatch/http/headers.rb b/actionpack/lib/action_dispatch/http/headers.rb index d5eef2987d..0528a6ad08 100644 --- a/actionpack/lib/action_dispatch/http/headers.rb +++ b/actionpack/lib/action_dispatch/http/headers.rb @@ -86,7 +86,7 @@ module ActionDispatch @req.fetch_header(env_name(key)) do return default unless default == DEFAULT return yield if block_given? - raise NameError, key + raise KeyError, key end end -- cgit v1.2.3