Skip to content
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

URL Path is over-escaped for *special characters* such as SEMICOLON, COLON, EQUALS SIGN #56

Open
besfahbod opened this issue Mar 11, 2021 · 0 comments

Comments

@besfahbod
Copy link
Contributor

Last paragraph of https://tools.ietf.org/html/rfc3986#section-3.3 says:

Aside from dot-segments in hierarchical paths, a path segment is
considered opaque by the generic syntax. URI producing applications
often use the reserved characters allowed in a segment to delimit
scheme-specific or dereference-handler-specific subcomponents. For
example, the semicolon (";") and equals ("=") reserved characters are
often used to delimit parameters and parameter values applicable to
that segment. The comma (",") reserved character is often used for
similar purposes. For example, one URI producer might use a segment
such as "name;v=1.1" to indicate a reference to version 1.1 of
"name", whereas another might use a segment such as "name,1.1" to
indicate the same. Parameter types may be defined by scheme-specific
semantics, but in most cases the syntax of a parameter is specific to
the implementation of the URI's dereferencing algorithm.

This means, these special characters can be present in path, carrying special information.

In other words, they are supposed to be escaped only if they are expected not to carry the special information, like if they appear in a directory name on the file-system.

On Chrome, these comparisons are all truthful:

String(new URL("http://example.com/alice=bob")) == "http://example.com/alice=bob"
String(new URL("http://example.com/alice;bob")) == "http://example.com/alice;bob"
String(new URL("http://example.com/alice,bob")) == "http://example.com/alice,bob"

I think domurl should be able to parse and re-gen those values as well. Wdyt?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant