-
Notifications
You must be signed in to change notification settings - Fork 358
Align redirect fragment handling with HTTP #696
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
Conversation
This comment has been minimized.
This comment has been minimized.
See whatwg/fetch#505. Tests: ... Corresponding Fetch PR: whatwg/fetch#696.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If fetch()
is going to return fragments on the Response.url
, should the fetch spec also handle fragment propagation on redirects? I don't think it currently does because html spec handles navigation redirects.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We probably need service worker fixes before this can be implemented. Consider:
- If a
FetchEvent.request.url
has a fragment, butResponse.url
does not, then we want to propagate the request fragment to the new response URL. - We need to do something if the FetchEvent request and response URLs have different fragments. I guess Response fragment wins?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I assume fragments will need to be stored in Cache API. This should be fine in the spec since I believe it just holds Response objects. In practice, though, you may run into situations where a site has old Response values without a fragment in Cache API and new Response objects with a fragment. Not sure there is anything we can do to fix that, but its something to consider.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These changes seem fine, but see my other comments about other things that need to be addressed before implementation. Thanks!
ee53836
to
53de36a
Compare
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
FWIW, the bit I implemented for propagating the request fragment to the final response in firefox is here: |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
d50c213
to
bb1c332
Compare
This clarifies how fragment conflicts between the request's current URL and the Location header are resolved (the latter wins if non-null). This is the same for documents and subresources. Tests: web-platform-tests/wpt#27575. HTML change: whatwg/html#6391. Follow-ups: #1167 and #1175. Fixes #505.
0d779b6
to
99e0110
Compare
I've reduced the scope of this PR (for the second time) to be about redirects only and filed a second follow-up issue, this time for service workers. Who knew fragments would be this much fun. |
Automatic update from web-platform-tests Fetch: fragments Tests for whatwg/fetch#696. -- wpt-commits: e8181c07ac768f4fc5c7b74016a8e51226717400 wpt-pr: 27575
@davidben @wanderview any concerns with merging this (and the HTML PR) now that the service worker bits have been moved to #1175? |
Automatic update from web-platform-tests Fetch: fragments Tests for whatwg/fetch#696. -- wpt-commits: e8181c07ac768f4fc5c7b74016a8e51226717400 wpt-pr: 27575 UltraBlame original commit: 429a832dd2419ede43885279864503338753fd61
Automatic update from web-platform-tests Fetch: fragments Tests for whatwg/fetch#696. -- wpt-commits: e8181c07ac768f4fc5c7b74016a8e51226717400 wpt-pr: 27575 UltraBlame original commit: 429a832dd2419ede43885279864503338753fd61
Automatic update from web-platform-tests Fetch: fragments Tests for whatwg/fetch#696. -- wpt-commits: e8181c07ac768f4fc5c7b74016a8e51226717400 wpt-pr: 27575 UltraBlame original commit: 429a832dd2419ede43885279864503338753fd61
Complements whatwg/fetch#696. See that pull request for context and tests.
In the location URL algorithm:
The variable |
Thanks, I created #1180 to address that. |
Automatic update from web-platform-tests Fetch: fragments Tests for whatwg/fetch#696. -- wpt-commits: e8181c07ac768f4fc5c7b74016a8e51226717400 wpt-pr: 27575
Automatic update from web-platform-tests Fetch: fragments Tests for whatwg/fetch#696. -- wpt-commits: e8181c07ac768f4fc5c7b74016a8e51226717400 wpt-pr: 27575
Automatic update from web-platform-tests Fetch: fragments Tests for whatwg/fetch#696. -- wpt-commits: e8181c07ac768f4fc5c7b74016a8e51226717400 wpt-pr: 27575
Automatic update from web-platform-tests Fetch: fragments Tests for whatwg/fetch#696. -- wpt-commits: e8181c07ac768f4fc5c7b74016a8e51226717400 wpt-pr: 27575 UltraBlame original commit: 2cdf82ffca4a04f470664a28dc850457a5ebe88a
Automatic update from web-platform-tests Fetch: fragments Tests for whatwg/fetch#696. -- wpt-commits: e8181c07ac768f4fc5c7b74016a8e51226717400 wpt-pr: 27575 UltraBlame original commit: 6364dbe87f3fc92171b65a6884434b80904e2b29
Automatic update from web-platform-tests Fetch: fragments Tests for whatwg/fetch#696. -- wpt-commits: e8181c07ac768f4fc5c7b74016a8e51226717400 wpt-pr: 27575 UltraBlame original commit: 2cdf82ffca4a04f470664a28dc850457a5ebe88a
Automatic update from web-platform-tests Fetch: fragments Tests for whatwg/fetch#696. -- wpt-commits: e8181c07ac768f4fc5c7b74016a8e51226717400 wpt-pr: 27575 UltraBlame original commit: 6364dbe87f3fc92171b65a6884434b80904e2b29
Automatic update from web-platform-tests Fetch: fragments Tests for whatwg/fetch#696. -- wpt-commits: e8181c07ac768f4fc5c7b74016a8e51226717400 wpt-pr: 27575 UltraBlame original commit: 2cdf82ffca4a04f470664a28dc850457a5ebe88a
Automatic update from web-platform-tests Fetch: fragments Tests for whatwg/fetch#696. -- wpt-commits: e8181c07ac768f4fc5c7b74016a8e51226717400 wpt-pr: 27575 UltraBlame original commit: 6364dbe87f3fc92171b65a6884434b80904e2b29
Automatic update from web-platform-tests Fetch: fragments Tests for whatwg/fetch#696. -- wpt-commits: e8181c07ac768f4fc5c7b74016a8e51226717400 wpt-pr: 27575
This clarifies how fragment conflicts between the request's current URL
and the Location header are resolved (the latter wins if non-null).
This is the same for documents and subresources.
Tests: web-platform-tests/wpt#27575.
HTML change: whatwg/html#6391.
Follow-ups: #1167 and #1175.
Fixes #505.
(See WHATWG Working Mode: Changes for more details.)
Preview | Diff