File tree 2 files changed +9
-12
lines changed
2 files changed +9
-12
lines changed Original file line number Diff line number Diff line change @@ -76,14 +76,11 @@ sub status_line
76
76
sub base
77
77
{
78
78
my $self = shift ;
79
- my $base = $self -> header(' Content-Base' ) || # used to be HTTP/1.1
80
- $self -> header(' Content-Location' ) || # HTTP/1.1
81
- $self -> header(' Base' ); # HTTP/1.0
82
- if ($base ) {
83
- # handle multiple values (take first one), drop parameters
84
- require HTTP::Headers::Util;
85
- $base = (HTTP::Headers::Util::split_header_words($base ))[0]-> [0];
86
- }
79
+ my $base = (
80
+ $self -> header(' Content-Base' ), # used to be HTTP/1.1
81
+ $self -> header(' Content-Location' ), # HTTP/1.1
82
+ $self -> header(' Base' ), # HTTP/1.0
83
+ )[0];
87
84
if ($base && $base =~ / ^$URI::scheme_re :/o ) {
88
85
# already absolute
89
86
return $HTTP::URI_CLASS -> new($base );
Original file line number Diff line number Diff line change @@ -94,9 +94,9 @@ for ($r->redirects) {
94
94
}
95
95
96
96
ok($r -> base, $r -> request-> uri);
97
- $r -> push_header(" Content-Location" , " /1/" );
98
- ok($r -> base, " http://www.sn.no/1/" );
97
+ $r -> push_header(" Content-Location" , " /1/A/a " );
98
+ ok($r -> base, " http://www.sn.no/1/A/a " );
99
99
$r -> push_header(" Content-Base" , " /2/;a=/foo/bar" );
100
- ok($r -> base, " http://www.sn.no/2/" ); # parameters stripped, -Base > -Location
100
+ ok($r -> base, " http://www.sn.no/2/;a=/foo/bar " );
101
101
$r -> push_header(" Content-Base" , " /3/" );
102
- ok($r -> base, " http://www.sn.no/2/" ); # first one of multiple prevails
102
+ ok($r -> base, " http://www.sn.no/2/;a=/foo/bar " );
You can’t perform that action at this time.
0 commit comments