Re: [whatwg/url] Should we unescape characters in path? (#606)

We already define that `%2E` and `%2e` are equivalent to `.` in path components (even a mixed component like `.%2E` is treated equivalently to `..`). 

We also _add_ percent-encoding for certain characters - both in the parser and via the component setters. It logically follows that we expect anybody who processes the resulting URL to treat them as equivalent, otherwise we would have produced a URL which points to a different resource than the user intended.

Basically, if we're not happy with saying that `%61` must always be the same as `a` (and that is the only interpretation), then the following operation:

```javascript
var url = new URL("http://example.com/foo/bar");

url.href; // "http://example.com/foo/bar"

url.pathname = "what should this do???";

url.href; // "http://example.com/what%20should%20this%20do%3F%3F%3F"
```

Should also fail. Otherwise, the string `what%20should%20this%20do%3F%3F%3F` is not necessarily the same as `what should this do???`.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/whatwg/url/issues/606#issuecomment-927111262

Received on Saturday, 25 September 2021 12:02:15 UTC