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 2006-01-14 18:38:15 +00:00
parent 866af7bc31
commit df016dc983
1 changed files with 8 additions and 7 deletions

View File

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