diff options
author | Gisle Aas <gisle@aas.no> | 2010-08-22 13:23:06 +0200 |
---|---|---|
committer | Gisle Aas <gisle@aas.no> | 2010-08-22 13:26:16 +0200 |
commit | d68f48165a1abe746fab5f2844acb23dcef17857 (patch) | |
tree | c8555d82fc115d7c3e6906fd00fea96d6c77e4c0 /t/old-base.t | |
parent | 8e33656530537ec9e3bfe2ef943f788cced7110a (diff) | |
download | uri-d68f48165a1abe746fab5f2844acb23dcef17857.tar.gz |
Treat ? as a reserved character in file: URIs
This seems to be the behaviour compatible with more current browsers.
Some additional rationale is found in this request:
---
Subject: URI: Query string do not work in file: URLs
From: Father Chrysostomos <sprout@cpan.org>
Message-Id: <0D380F9E-B2C1-4824-AE5E-A5B0A4A35E54@cpan.org>
Date: Sun, 15 Aug 2010 13:40:20 -0700
To: libwww@perl.org
URI::file has this little line in it:
sub path { shift->path_query(@_) }
which makes it impossible to test web pages offline (via file: rather
than http:). All web browsers I=92ve used allow a query string to be
added to a file URL, and require %3f to be used for files with question
marks in their names. The query string is not entirely useless. It
allows information to be passed to scripts embedded in the page.
Is there any chance this line could be removed?
Diffstat (limited to 't/old-base.t')
-rw-r--r-- | t/old-base.t | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/t/old-base.t b/t/old-base.t index 40d00ef..9c9ccdb 100644 --- a/t/old-base.t +++ b/t/old-base.t @@ -205,7 +205,7 @@ sub scheme_parse_test { 'file://host/fseg/fs?g/fseg' # don't escape ? for file: scheme - => { 'host'=>'host', 'path'=>'/fseg/fs?g/fseg', + => { 'host'=>'host', 'path'=>'/fseg/fs', 'as_string'=>'file://host/fseg/fs?g/fseg' }, 'gopher://host' @@ -931,7 +931,7 @@ EOM ["abc", "file:/test?aas", "file:/abc"], # ["gopher:", "", "gopher:"], # ["?foo", "http://abc/a", "http://abc/a?foo"], - ["?foo", "file:/abc", "file:/?foo"], + ["?foo", "file:/abc", "file:/abc?foo"], ["#foo", "http://abc/a", "http://abc/a#foo"], ["#foo", "file:a", "file:a#foo"], ["#foo", "file:/a", "file:/a#foo"], |