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
3030 $str = " " ;
3131 }
3232
33+ $status_line =~ s /\r\z // ;
34+
3335 my $self = $class -> SUPER::parse($str );
3436 my ($protocol , $code , $message );
3537 if ($status_line =~ / ^\d {3} / ) {
Original file line number Diff line number Diff line change @@ -5,7 +5,7 @@ use strict;
55use warnings;
66
77use Test::More;
8- plan tests => 29 ;
8+ plan tests => 30 ;
99
1010use HTTP::Date;
1111use HTTP::Request;
@@ -84,7 +84,9 @@ is($freshness_lifetime, 10);
8484ok($r -> fresh_until); # should return something
8585ok($r -> fresh_until(heuristic_expiry => 0)); # should return something
8686
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+
8890my @h = $r2 -> header(' Cache-Control' );
8991is(@h , 2);
9092
You can’t perform that action at this time.
0 commit comments