summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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;