Closed
Bug 758667
Opened 13 years ago
Closed 3 years ago
"|" should be percent-encoded when copying the location bar value
Categories
(Firefox :: Address Bar, defect, P5)
Tracking
()
RESOLVED
WORKSFORME
People
(Reporter: david, Unassigned)
Details
User Agent: Mozilla/5.0 (X11; Ubuntu; Linux i686; rv:12.0) Gecko/20100101 Firefox/12.0
Build ID: 20120423130206
Steps to reproduce:
Some characters are percent encoded when they should not be, and others are not percent encoded when they should be. First, an example in which firefox is failing to percent-encode when it should:
In the address bar, type: http://localhost/node/cardiology?|
(notice the trailing vertical bar or pipe), and then ENTER.
They copy and paste the URL from the address bar into a text editor to see what (hidden) percent encoding firefox performed.
Actual results:
Firefox did not percent-encode the vertical bar. The URL pastes as
http://localhost/node/cardiology?|
(Note that the trailing vertical bar was not percent-encoded, even though it is not permitted in the query string of a URI per RFC3986.)
Expected results:
The vertical bar character should have been percent-encoded, per RFC3986.
MORE EXPLANATION:
A URL with the less-than character ("<") *is* properly percent-encoded, so this:
http://localhost/node/cardiology?<
is percent encoded as this:
http://localhost/node/cardiology?%3C
HOWEVER, this URL containing parentheses in the query string:
http://localhost/node/cardiology?()
is being percent encoded as:
http://localhost/node/cardiology?%28%29
even though the parentheses SHOULD NOT be percent encoded in the query string:
From RFC 3986:
http://www.ietf.org/rfc/rfc3986.txt
[[
6.2.2.2. Percent-Encoding Normalization
The percent-encoding mechanism (Section 2.1) is a frequent source of
variance among otherwise identical URIs. In addition to the case
normalization issue noted above, some URI producers percent-encode
octets that do not require percent-encoding, resulting in URIs that
are equivalent to their non-encoded counterparts. These URIs should
be normalized by decoding any percent-encoded octet that corresponds
to an unreserved character, as described in Section 2.3.
]]
And here are the relevant syntax rules for a query string from Appendix A of RFC3986:
[[
query = *( pchar / "/" / "?" )
pchar = unreserved / pct-encoded / sub-delims / ":" / "@"
unreserved = ALPHA / DIGIT / "-" / "." / "_" / "~"
pct-encoded = "%" HEXDIG HEXDIG
sub-delims = "!" / "$" / "&" / "'" / "(" / ")"
/ "*" / "+" / "," / ";" / "="
]]
Notice that parentheses are clearly permitted in a query string.
SIDE NOTE: Personally, I hate the fact that firefox is displaying a different URL (i.e., showing it without percent encoding) than what it actually uses (the percent-encoded version), and I think this "feature" should be disabled by default, but that's a separate issue. In any case, if firefox is doing percent encoding then it should do it properly.
Updated•12 years ago
|
Component: Untriaged → Location Bar
QA Contact: untriaged → location.bar
Comment 1•12 years ago
|
||
We intentionally encode parentheses because they're often not handled correctly by external software. See bug 458565.
Summary: Address bar is not percent % URL encoding / escaping properly → "|" should be percent-encoded when copying the location bar value
Comment 2•7 years ago
|
||
Per policy at https://wiki.mozilla.org/Bug_Triage/Projects/Bug_Handling/Bug_Husbandry#Inactive_Bugs. If this bug is not an enhancement request or a bug not present in a supported release of Firefox, then it may be reopened.
Status: UNCONFIRMED → RESOLVED
Closed: 7 years ago
Resolution: --- → INACTIVE
Updated•6 years ago
|
Status: RESOLVED → REOPENED
Ever confirmed: true
Priority: -- → P5
Resolution: INACTIVE → ---
Comment 3•3 years ago
|
||
Hi, I think that this bug is no longer valid in the face of the latest changes on the browser. If I'm mistaken, please reopen it.
Regards, Flor.
Status: REOPENED → RESOLVED
Closed: 7 years ago → 3 years ago
Resolution: --- → WORKSFORME
You need to log in
before you can comment on or make changes to this bug.
Description
•