From 0585d038ba908af5d49c48ddeb1394b2f3579331 Mon Sep 17 00:00:00 2001
From: Dominic Hargreaves <dom@earth.li>
Date: Sat, 10 Jun 2017 20:40:29 +0100
Subject: [PATCH] Fix test failures with CSRF protection fix

This seems to be an omission from the upstream patchset

Patch-Name: patchset-2017-06-01-test-failures.patch
---
 t/web/csrf.t | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/t/web/csrf.t b/t/web/csrf.t
index 9d95d06..d9ceb1a 100644
--- a/t/web/csrf.t
+++ b/t/web/csrf.t
@@ -38,7 +38,7 @@ $m->title_is('Create a new ticket');
 $m->add_header(Referer => 'http://example.net');
 $m->get_ok($test_page);
 $m->content_contains("Possible cross-site request forgery");
-$m->content_contains("If you really intended to visit <tt>/Ticket/Create.html</tt>");
+$m->content_contains("If you really intended to visit <tt>http://localhost:$RT::Test::port/Ticket/Create.html</tt>");
 $m->content_contains("the Referrer header supplied by your browser (example.net:80) is not allowed");
 $m->title_is('Possible cross-site request forgery');
 
@@ -60,7 +60,7 @@ $m->title_is('#1: bad music');
 # now a non-whitelisted argument
 $m->get_ok("/Ticket/Display.html?id=1&Action=Take");
 $m->content_contains("Possible cross-site request forgery");
-$m->content_contains("If you really intended to visit <tt>/Ticket/Display.html</tt>");
+$m->content_contains("If you really intended to visit <tt>http://localhost:$RT::Test::port/Ticket/Display.html</tt>");
 $m->content_contains("the Referrer header supplied by your browser (example.net:80) is not allowed");
 $m->title_is('Possible cross-site request forgery');
 
@@ -75,7 +75,7 @@ $m->content_contains('Owner changed from Nobody to root');
 $m->add_header(Referer => undef);
 $m->get_ok($test_page);
 $m->content_contains("Possible cross-site request forgery");
-$m->content_contains("If you really intended to visit <tt>/Ticket/Create.html</tt>");
+$m->content_contains("If you really intended to visit <tt>http://localhost:$RT::Test::port/Ticket/Create.html</tt>");
 $m->content_contains("your browser did not supply a Referrer header");
 $m->title_is('Possible cross-site request forgery');
 
@@ -89,7 +89,7 @@ $m->title_is('Create a new ticket');
 $m->add_header(Referer => undef);
 $m->get_ok($test_page);
 $m->content_contains("Possible cross-site request forgery");
-$m->content_contains("If you really intended to visit <tt>/Ticket/Create.html</tt>");
+$m->content_contains("If you really intended to visit <tt>http://localhost:$RT::Test::port/Ticket/Create.html</tt>");
 $m->content_contains("your browser did not supply a Referrer header");
 $m->title_is('Possible cross-site request forgery');
 
@@ -112,7 +112,7 @@ my ($token) = $m->content =~ m{CSRF_Token=(\w+)};
 $m->add_header(Referer => undef);
 $m->get_ok("/Admin/Queues/Modify.html?id=new&Name=test&CSRF_Token=$token");
 $m->content_contains("Possible cross-site request forgery");
-$m->content_contains("If you really intended to visit <tt>/Admin/Queues/Modify.html</tt>");
+$m->content_contains("If you really intended to visit <tt>http://localhost:$RT::Test::port/Admin/Queues/Modify.html</tt>");
 $m->content_contains("your browser did not supply a Referrer header");
 $m->title_is('Possible cross-site request forgery');
 
@@ -145,7 +145,7 @@ $m->field('Attach',  $logofile);
 $m->add_header(Referer => undef);
 $m->submit;
 $m->content_contains("Possible cross-site request forgery");
-$m->content_contains("If you really intended to visit <tt>/Ticket/Create.html</tt>");
+$m->content_contains("If you really intended to visit <tt>http://localhost:$RT::Test::port/Ticket/Create.html</tt>");
 $m->follow_link(text_regex => qr{resume your request});
 $m->content_contains('Download bpslogo.png', 'page has file name');
 $m->follow_link_ok({text => "Download bpslogo.png"});
@@ -165,7 +165,7 @@ $m->content_contains("My open tickets", "got self-service interface");
 $m->add_header(Referer => undef);
 $m->get_ok("/SelfService/Create.html?Queue=1");
 $m->content_contains("Possible cross-site request forgery");
-$m->content_contains("If you really intended to visit <tt>/SelfService/Create.html</tt>");
+$m->content_contains("If you really intended to visit <tt>http://localhost:$RT::Test::port/SelfService/Create.html</tt>");
 $m->content_contains("your browser did not supply a Referrer header");
 $m->title_is('Possible cross-site request forgery');
 
-- 
2.1.4

