You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I wonder if it is expected behaviour from URI's url absolution (ok absolutisation) to still retain relative path components in final url. Someone (ikegami) at perlmonks said that this is violation of section 5.4.2 of RFC 3986
Here is a script to reproduce the problem (using perl 5.22, URI v1.73, LWP::UserAgent v6.33) :
!/usr/bin/env perl
use strict;
use warnings;
use URI;
# a relative url:
my $rel_url = '../../../../../abc.html';
# the base url, where I stand now:
my @base_uris = ('http://server.com/123/xyz',
'http://server.com/1/2/3/4/5',
'http://server.com/1/2/3/4/5/');
# URI's absolute url:
foreach my $abase (@base_uris){
my $uri = URI->new_abs( $rel_url, $abase );
print "absolute for base: $abase is\n\t".$uri."\n";
}
yields:
http://server.com/../../../../abc.html
absolute for base: http://server.com/1/2/3/4/5 is
http://server.com/../abc.html
absolute for base: http://server.com/1/2/3/4/5/ is
http://server.com/abc.html
The last response is correct but I wonder whether for the first two cases URI should have used some heuristics to remove that ..
The text was updated successfully, but these errors were encountered:
I wonder if it is expected behaviour from URI's url absolution (ok absolutisation) to still retain relative path components in final url. Someone (ikegami) at perlmonks said that this is violation of section 5.4.2 of RFC 3986
Here is a script to reproduce the problem (using perl 5.22, URI v1.73, LWP::UserAgent v6.33) :
yields:
The last response is correct but I wonder whether for the first two cases URI should have used some heuristics to remove that
..
The text was updated successfully, but these errors were encountered: