File tree Expand file tree Collapse file tree 2 files changed +6
-2
lines changed Expand file tree Collapse file tree 2 files changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -30,6 +30,8 @@ sub parse
30
30
$str = " " ;
31
31
}
32
32
33
+ $status_line =~ s /\r\z // ;
34
+
33
35
my $self = $class -> SUPER::parse($str );
34
36
my ($protocol , $code , $message );
35
37
if ($status_line =~ / ^\d {3} / ) {
Original file line number Diff line number Diff line change @@ -5,7 +5,7 @@ use strict;
5
5
use warnings;
6
6
7
7
use Test::More;
8
- plan tests => 29 ;
8
+ plan tests => 30 ;
9
9
10
10
use HTTP::Date;
11
11
use HTTP::Request;
@@ -84,7 +84,9 @@ is($freshness_lifetime, 10);
84
84
ok($r -> fresh_until); # should return something
85
85
ok($r -> fresh_until(heuristic_expiry => 0)); # should return something
86
86
87
- my $r2 = HTTP::Response-> parse($r -> as_string);
87
+ my $r2 = HTTP::Response-> parse($r -> as_string( " \x0d\x0a " ));
88
+ is( $r2 -> message(), ' OK' , ' message() returns as expected' );
89
+
88
90
my @h = $r2 -> header(' Cache-Control' );
89
91
is(@h , 2);
90
92
You can’t perform that action at this time.
0 commit comments