-
Notifications
You must be signed in to change notification settings - Fork 141
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Encode ^ in pathname #607
Comments
It seems to depend on "is special" in Chrome and Firefox, which isn't ideal. |
I mean, Chrome and Firefox don't even escape spaces (or anything not in the C0 controls set) in non-special paths… |
3986 defines path segments to contain these characters: pchar = unreserved / pct-encoded / sub-delims / ":" / "@"
unreserved = ALPHA / DIGIT / "-" / "." / "_" / "~"
sub-delims = "!" / "$" / "&" / "'" / "(" / ")"
/ "*" / "+" / "," / ";" / "=" That doesn't include |
@achristensen07 Are you okay with aligning Safari on this? |
I think so. This is a case where Chrome and Firefox have the same behavior, so aligning with them would likely increase compatibility. It looks like the most compatible solution depends on "is special" |
FYI. The discussion around issue #379 has a good overview of the percent encode sets. |
FWIW, I've been looking at interoperability between this standard and the The biggest difficulty in getting Foundation to parse the serialised output of this standard is the difference in percent-encode sets. This makes it harder for applications to transition to a web-compatible URL model, as converting to a Foundation URL means adding percent-encoding, so the serialised URL string changes. Anything which minimises that would be appreciated, and if it is actually a better description of how browsers behave, it seems like a no-brainer. That said, if Safari currently does not encode it, and Chrome/Firefox conditionalise it, and neither of them "broke the web", it seems reasonable to conclude that few if any sites actually care whether it is encoded or not. In that case, the better choice IMO would be to unconditionally encode it and align with RFC-3986 as a bonus. Conditional percent-encode sets are awful. |
It seems Gecko branches on "is special", but Chromium doesn't. Chromium branches on "opaque path", which seems more reasonable? I would be willing to align WebKit and the standard with Chromium here (assuming that @achristensen07 is still on board). @hayatoito @valenting what do you think? |
I am strongly in favor of doing this. Aligning the standard with Chromium seems like a good path forward. |
Sounds good to me. I checked the Chromium's implementation. As you noticed, the current implementation doesn't branch whether "is special" or "is not special" on percent encoding of path. I don't have any intention here; I didn't know this is not Standard compliant until now. |
This gives "a%5Eb" in Chrome and Firefox, in addition to Go and Node.js. Ruby's
URI
fails to parse the URL with^
, but is fine with %5E. However, the spec and Safari don't escape^
at the moment.Shall we escape
^
in paths? This will cause U+005E (^) to be moved from the userinfo set to path set.The text was updated successfully, but these errors were encountered: