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

Improve the description of the rules for relative NOR requests and add examples #118

Open
wilaw opened this issue Jan 10, 2024 · 0 comments

Comments

@wilaw
Copy link
Contributor

wilaw commented Jan 10, 2024

[From Chris Lemmons]
Relative path resolution is defined in https://datatracker.ietf.org/doc/html/rfc3986 (which, in retrospect, we should have cited).

The way relative paths are merged is defined in 5.2.3. Relevant here:

o return a string consisting of the reference's path component
appended to all but the last segment of the base URI's path (i.e.,
excluding any characters after the right-most "/" in the base URI
path, or excluding the entire base URI path if it does not contain
any "/" characters).

So, the following prefetch uri should work:

y.mp4
./y.mp4
/a/b/y.mp4

These are legal, but go to the wrong place:

b/y.mp4 will go to https://example.com/a/b/b/y.mp4
../y.mp4 will go to https://example.com/a/y.mp4
../../y.mp4 will go to https://example.com/y.mp4
/y.mp4 will go to https://example.com/y.mp4
/b/y.mp4 will go to https://example.com/b/y.mp4
/a/y.mp4 will go to https://example.com/a/y.mp4

We probably should have cited the URI spec to indicate where the relative path goes, but since that’s how HTML uses it and browsers expect it, I suspect the RFC’s definition will match people’s intuition. And there’s a very tiny technical nit (that we should fix) because the RFC defines the base URI relative to the representation request URI and in our situation, this is part of the request itself, not the representation being responded with. Still, I think it’ll match the intuition.

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