Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Fix duplicate headers in response

  • Loading branch information...
commit 9162ec1df98faac82f4a9d067a6bbcc792cee9f5 1 parent bea970d
@gbarr authored
View
1  Changes.txt
@@ -2,6 +2,7 @@ Revision history for LWP-Protocol-AnyEvent-http
1.0.4 2012-mm-dd
- Preserve AnyEvent::HTTP pseudo heads by prefixing with X-AE-
+ - Fix duplicate headers in response
1.0.3 2011-06-17
- Skip tests that will fail due to DNS hijacking.
View
2  lib/LWP/Protocol/AnyEvent/http.pm
@@ -38,7 +38,7 @@ sub _set_response_headers {
];
}
- $response->push_header(%headers);
+ $response->header(%headers);
}
View
4 t/04_error_404.t
@@ -35,10 +35,14 @@ my $chunk_count = 0;
my $res = $client->get("${url}error/notfound/foo", ":content_cb" => sub {
$chunk_count++
});
+
+my $date_count = () = $res->headers->as_string =~ m!^(Date:)!mig;
+
ok !$res->is_success, "The request was not successfull, as planned";
is $res->code, 404, "We caught the remote error (404)";
is $res->content, '', "We got an empty response";
is $chunk_count, 0, "We received no chunks either";
+is $date_count, 1, "Only 1 Date header in response";
undef $t; # stop the timer
Please sign in to comment.
Something went wrong with that request. Please try again.