aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test/dispatch
diff options
context:
space:
mode:
authorDaniel Colson <danieljamescolson@gmail.com>2018-01-28 12:53:11 -0500
committerDaniel Colson <danieljamescolson@gmail.com>2018-01-29 19:35:39 -0500
commiteea28f4103f0a55e50ce750582317110c988afcd (patch)
tree02287f553328e14f2529e70ef434d7c6a5cf9219 /actionpack/test/dispatch
parent2f9549d4f46ca1f9cc437d4f89bd8df405e28dbd (diff)
downloadrails-eea28f4103f0a55e50ce750582317110c988afcd.tar.gz
rails-eea28f4103f0a55e50ce750582317110c988afcd.tar.bz2
rails-eea28f4103f0a55e50ce750582317110c988afcd.zip
Allow @ in X-Request-Id header
It makes sense to be as strict as possible with headers from the outside world, but allowing @ to support Apache's mod_unique_id (see #31644) seems OK to me
Diffstat (limited to 'actionpack/test/dispatch')
-rw-r--r--actionpack/test/dispatch/request_id_test.rb5
1 files changed, 5 insertions, 0 deletions
diff --git a/actionpack/test/dispatch/request_id_test.rb b/actionpack/test/dispatch/request_id_test.rb
index aa3175c986..9df4712dab 100644
--- a/actionpack/test/dispatch/request_id_test.rb
+++ b/actionpack/test/dispatch/request_id_test.rb
@@ -11,6 +11,11 @@ class RequestIdTest < ActiveSupport::TestCase
assert_equal "X-Hacked-HeaderStuff", stub_request("HTTP_X_REQUEST_ID" => "; X-Hacked-Header: Stuff").request_id
end
+ test "accept Apache mod_unique_id format" do
+ mod_unique_id = "abcxyz@ABCXYZ-0123456789"
+ assert_equal mod_unique_id, stub_request("HTTP_X_REQUEST_ID" => mod_unique_id).request_id
+ end
+
test "ensure that 255 char limit on the request id is being enforced" do
assert_equal "X" * 255, stub_request("HTTP_X_REQUEST_ID" => "X" * 500).request_id
end