Browse Source

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
svn/tags/lighttpd-1.4.11
Jan Kneschke 17 years ago
parent
commit
df016dc983
  1. 15
      tests/LightyTest.pm

15
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;

Loading…
Cancel
Save