From 015a06cbd71b7c78d3b282fb19db5a99afdd66fb Mon Sep 17 00:00:00 2001 From: Tom Hughes Date: Fri, 20 Dec 2024 10:18:12 +0000 Subject: [PATCH] Avoid parsing of XML requests with ; in the body --- test/controllers/api/old_nodes_controller_test.rb | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/test/controllers/api/old_nodes_controller_test.rb b/test/controllers/api/old_nodes_controller_test.rb index 8ce19f3ea2..151018e1e3 100644 --- a/test/controllers/api/old_nodes_controller_test.rb +++ b/test/controllers/api/old_nodes_controller_test.rb @@ -48,7 +48,7 @@ def test_version propagate_tags(node, node.old_nodes.last) ## First try this with a non-public user - auth_header = bearer_authorization_header private_user + auth_header = request_headers private_user # setup a simple XML node xml_doc = xml_for_node(private_node) @@ -95,7 +95,7 @@ def test_version # probably should check that they didn't get written to the database ## Now do it with the public user - auth_header = bearer_authorization_header user + auth_header = request_headers user # setup a simple XML node @@ -482,5 +482,9 @@ def propagate_tags(node, old_node) create(:old_node_tag, :old_node => old_node, :k => k, :v => v) end end + + def request_headers(user) + bearer_authorization_header(user).merge("Content-Type" => "application/xml") + end end end