From f0e7326c2082803fa9058482dbcc07ced7f63512 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim=20R=C3=BChsen?= Date: Wed, 26 Nov 2014 12:25:40 +0100 Subject: [PATCH] Perl test suite: Substitue server port in HTTP headers --- tests/ChangeLog | 8 ++++++++ tests/HTTPServer.pm | 1 + 2 files changed, 9 insertions(+) diff --git a/tests/ChangeLog b/tests/ChangeLog index 9ab68ece..4f816797 100644 --- a/tests/ChangeLog +++ b/tests/ChangeLog @@ -1,3 +1,11 @@ +2014-11-26 Tim Ruehsen + + * HTTPServer.pm: Substitue server port in HTTP headers + + This allows us to use references like + "Location" => "http://localhost:{{port}}/whatever + in test cases. + 2014-11-05 Tim Ruehsen * Makefile.am: added $(LIB_CLOCK_GETTIME) to unit test linkage diff --git a/tests/HTTPServer.pm b/tests/HTTPServer.pm index aacc460c..dd8ec043 100644 --- a/tests/HTTPServer.pm +++ b/tests/HTTPServer.pm @@ -98,6 +98,7 @@ sub send_response while (my ($name, $value) = each %{$headers}) { # print STDERR "setting header: $name = $value\n"; + $value = $self->_substitute_port($value); $resp->header($name => $value); } print STDERR "HTTP::Response with headers: \n", $resp->as_string if $log;