summaryrefslogtreecommitdiff
path: root/tests/LightyTest.pm
diff options
context:
space:
mode:
authorJan Kneschke <jan@kneschke.de>2006-01-14 18:38:15 +0000
committerJan Kneschke <jan@kneschke.de>2006-01-14 18:38:15 +0000
commitdf016dc98330be0e790b7fb5cb8eb39fb9994e16 (patch)
treeb1e1858ffbf37255fcf190ec2ebc82cce79f5831 /tests/LightyTest.pm
parent866af7bc31c87b47b7938ec50ba189ce66520b61 (diff)
downloadlighttpd-git-df016dc98330be0e790b7fb5cb8eb39fb9994e16.tar.gz
give a warning on duplicate response headers
git-svn-id: svn://svn.lighttpd.net/lighttpd/branches/lighttpd-merge-1.4.x@952 152afb58-edef-0310-8abb-c4023f1b3aa9
Diffstat (limited to 'tests/LightyTest.pm')
-rwxr-xr-xtests/LightyTest.pm15
1 files changed, 8 insertions, 7 deletions
diff --git a/tests/LightyTest.pm b/tests/LightyTest.pm
index 37023d3b..85a08efb 100755
--- a/tests/LightyTest.pm
+++ b/tests/LightyTest.pm
@@ -158,6 +158,8 @@ sub handle_http {
close $remote;
+ my $full_response = $lines;
+
my $href;
foreach $href ( @{ $t->{RESPONSE} }) {
# first line is always response header
@@ -181,13 +183,12 @@ sub handle_http {
if ($line =~ /^([^:]+):\s*(.+)$/) {
(my $h = $1) =~ tr/[A-Z]/[a-z]/;
-# if (defined $resp_hdr{$h}) {
-# diag(sprintf("header %s is duplicated: %s and %s\n",
-# $h, $resp_hdr{$h}, $2));
-# return -1;
-# }
-
- $resp_hdr{$h} = $2;
+ if (defined $resp_hdr{$h}) {
+ diag(sprintf("header %s is duplicated: %s and %s\n",
+ $h, $resp_hdr{$h}, $2));
+ } else {
+ $resp_hdr{$h} = $2;
+ }
} else {
diag(sprintf("unexpected line '$line'\n"));
return -1;