Re: [w3c/manifest] Should the scope terminate by "/"? (#554)

Is this the originally intended behaviour, or a historical accident? It seems rather unintuitive.

To get technical...

> If ... *target*'s `pathname` starts with *scope*'s `pathname`, return `true`.

*target* and *scope* are URLs, not `URL` objects (URL = spec-level object, `URL` = user-facing object). I think specs should be using the [URL path](https://url.spec.whatwg.org/#concept-url-path) concept, not the [`URL.pathname`](https://url.spec.whatwg.org/#dom-url-pathname) interface attribute.

The important difference is that [URL path](https://url.spec.whatwg.org/#concept-url-path) is a list of strings, one for each path segment. If you used that, you wouldn't get this weird behaviour where the scope matches path segments with the same prefix. The only text change would be:

> If ... *target*'s path starts with *scope*'s path, return `true`.

I wonder if it isn't too late to change this. Though there are existing implementations, there might not be much code in the wild that relies on this behaviour.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/w3c/manifest/issues/554#issuecomment-317338171

Received on Monday, 24 July 2017 07:13:25 UTC