-
Notifications
You must be signed in to change notification settings - Fork 336
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
Request.destination for <link rel=prefetch>
#658
Comments
Why does it need to be different from |
Maybe using initiator would be better if the purpose is just a unique CSP directive? |
It seems reasonable to me that we'd continue using If we don't have that information, I'd be fine either doing the same thing we do for |
Presumably, a separate destination would enable SW code to know this fetch is speculative and destined for the next navigation. At the same time, I'm not aware of a concrete use-case for that.
For CSP that would work as well. |
The
I'm fine with folding |
Will |
|
I see, in that case we should leave the (destination) default as the empty string. I think initiator is the way to go to distinguish it as prefetch. (We could also add a separator initiator for preload if desired.) If service workers want to know this information at some point we could expose initiator to script, though we should not do so until we've carefully scrutinized it as the existing values are limited to what we needed for specifications only. |
I continue not to understand why we have both @yoavweiss: Can I ask you and @igrigorik to define some |
@mikewest sure! I believe
OTOH, if we would eventually need to expose it to users, a new |
@yoavweiss: Great! Some of these might be less Fetchy than others, but what about |
|
Yes, the caching situation is not well defined, similarly to the rest of the platform's caching. I agree that Someone™ should define that. I also think that properly defining it (while accounting for the current implementation differences) is a fairly large project. Personally, I'm afraid I won't be able to tackle in the near future. |
Fetch defines various connection concepts: https://fetch.spec.whatwg.org/#connections, so It's not clear to me whether Fetch wants to talk about DNS. If not, It seems likely that folks who care about exfiltration would be interested in restricting both, as they clearly communicate to third-parties. I'd be fine with treating both as
I've lost track of both of these, honestly. If we've unshipped them, would you mind removing the code? :)
If it's in HTML, I think I can safely assume that it's setting properties correctly. |
I think the use cases I have listed in #634 might equally qualify for the |
@tomayac They could be, but how would you treat prefetches in this case differently than say, regular fetches? |
@yoavweiss One idea for a news publisher site might be to dynamically soft-fail most-viewed-article-type prefetches with a generic offline page. |
@tomayac I'm not sure I get the use case, and why would prefetched resources treated different than regular fetches in this case. If the prefetched resource is in Cache, is there a reason not to serve it? And if it's not in Cache, is there something different to be done between prefetched and non-prefetched resources? |
modulepreload is exquisitely well-defined, if I may say so myself ;). It just reuses the script type=module fetching machinery. |
The attack is simply There already appears to be a non-standard header Edit: It appears that at least Chrome (http://dev.chromium.org/developers/design-documents/dns-prefetching) and Firefox (http://bitsup.blogspot.com/2008/11/dns-prefetching-for-firefox.html) support the |
@yoavweiss Sorry, I was over-complicating things. You're right, you could still deal with the current network situation once the actual fetch happens, ignoring what may have happened during the prefetch. |
For clarity, dns-prefetch and preconnect concerns are tracked by w3c/webappsec-csp#282 and #683. I filed w3c/resource-hints#75 on X-DNS-Prefetch-Control. This issue will be resolved once #659 lands. Additional review of that appreciated. If there's anything else remaining here I strongly encourage you to file a new issue. It's rather crowded already. |
Currently `Request.destination` is set to "unknown" prefetch, but that was recently changed: Issue: whatwg/fetch#658 PR: whatwg/fetch#659 This CL aligns the destination values to the spec change. Bug: 832105 Change-Id: Ib9f21dcc6cf0ace27b7a810d3670cddc45b3b74f
Corresponding CSP change: w3c/webappsec-csp#283. Tests: web-platform-tests/wpt#9013. Closes #658.
Currently `Request.destination` is set to "unknown" prefetch, but that was recently changed: Issue: whatwg/fetch#658 PR: whatwg/fetch#659 This CL aligns the destination values to the spec change. Bug: 832105 Change-Id: Ib9f21dcc6cf0ace27b7a810d3670cddc45b3b74f Reviewed-on: https://chromium-review.googlesource.com/1029858 Commit-Queue: Yoav Weiss <[email protected]> Reviewed-by: Charlie Harrison <[email protected]> Reviewed-by: Yutaka Hirano <[email protected]> Cr-Commit-Position: refs/heads/master@{#554341}
Currently `Request.destination` is set to "unknown" prefetch, but that was recently changed: Issue: whatwg/fetch#658 PR: whatwg/fetch#659 This CL aligns the destination values to the spec change. Bug: 832105 Change-Id: Ib9f21dcc6cf0ace27b7a810d3670cddc45b3b74f Reviewed-on: https://chromium-review.googlesource.com/1029858 Commit-Queue: Yoav Weiss <[email protected]> Reviewed-by: Charlie Harrison <[email protected]> Reviewed-by: Yutaka Hirano <[email protected]> Cr-Commit-Position: refs/heads/master@{#554341}
Currently `Request.destination` is set to "unknown" prefetch, but that was recently changed: Issue: whatwg/fetch#658 PR: whatwg/fetch#659 This CL aligns the destination values to the spec change. Bug: 832105 Change-Id: Ib9f21dcc6cf0ace27b7a810d3670cddc45b3b74f Reviewed-on: https://chromium-review.googlesource.com/1029858 Commit-Queue: Yoav Weiss <[email protected]> Reviewed-by: Charlie Harrison <[email protected]> Reviewed-by: Yutaka Hirano <[email protected]> Cr-Commit-Position: refs/heads/master@{#554341}
…tonly Automatic update from web-platform-testsAlign Request.destination to spec Currently `Request.destination` is set to "unknown" prefetch, but that was recently changed: Issue: whatwg/fetch#658 PR: whatwg/fetch#659 This CL aligns the destination values to the spec change. Bug: 832105 Change-Id: Ib9f21dcc6cf0ace27b7a810d3670cddc45b3b74f Reviewed-on: https://chromium-review.googlesource.com/1029858 Commit-Queue: Yoav Weiss <[email protected]> Reviewed-by: Charlie Harrison <[email protected]> Reviewed-by: Yutaka Hirano <[email protected]> Cr-Commit-Position: refs/heads/master@{#554341} -- wpt-commits: 3c940291e9e8c30e8c7c401426160e3531639403 wpt-pr: 10657
…tonly Automatic update from web-platform-testsAlign Request.destination to spec Currently `Request.destination` is set to "unknown" prefetch, but that was recently changed: Issue: whatwg/fetch#658 PR: whatwg/fetch#659 This CL aligns the destination values to the spec change. Bug: 832105 Change-Id: Ib9f21dcc6cf0ace27b7a810d3670cddc45b3b74f Reviewed-on: https://chromium-review.googlesource.com/1029858 Commit-Queue: Yoav Weiss <yoavyoav.ws> Reviewed-by: Charlie Harrison <csharrisonchromium.org> Reviewed-by: Yutaka Hirano <yhiranochromium.org> Cr-Commit-Position: refs/heads/master{#554341} -- wpt-commits: 3c940291e9e8c30e8c7c401426160e3531639403 wpt-pr: 10657 UltraBlame original commit: b60142c1cc9a01efbb27b591c1828015ffa0a6cb
…tonly Automatic update from web-platform-testsAlign Request.destination to spec Currently `Request.destination` is set to "unknown" prefetch, but that was recently changed: Issue: whatwg/fetch#658 PR: whatwg/fetch#659 This CL aligns the destination values to the spec change. Bug: 832105 Change-Id: Ib9f21dcc6cf0ace27b7a810d3670cddc45b3b74f Reviewed-on: https://chromium-review.googlesource.com/1029858 Commit-Queue: Yoav Weiss <yoavyoav.ws> Reviewed-by: Charlie Harrison <csharrisonchromium.org> Reviewed-by: Yutaka Hirano <yhiranochromium.org> Cr-Commit-Position: refs/heads/master{#554341} -- wpt-commits: 3c940291e9e8c30e8c7c401426160e3531639403 wpt-pr: 10657 UltraBlame original commit: b60142c1cc9a01efbb27b591c1828015ffa0a6cb
…tonly Automatic update from web-platform-testsAlign Request.destination to spec Currently `Request.destination` is set to "unknown" prefetch, but that was recently changed: Issue: whatwg/fetch#658 PR: whatwg/fetch#659 This CL aligns the destination values to the spec change. Bug: 832105 Change-Id: Ib9f21dcc6cf0ace27b7a810d3670cddc45b3b74f Reviewed-on: https://chromium-review.googlesource.com/1029858 Commit-Queue: Yoav Weiss <yoavyoav.ws> Reviewed-by: Charlie Harrison <csharrisonchromium.org> Reviewed-by: Yutaka Hirano <yhiranochromium.org> Cr-Commit-Position: refs/heads/master{#554341} -- wpt-commits: 3c940291e9e8c30e8c7c401426160e3531639403 wpt-pr: 10657 UltraBlame original commit: b60142c1cc9a01efbb27b591c1828015ffa0a6cb
As mentioned in w3c/resource-hints#66, there's no current Request.destination defined for prefetched resources. We should probably define such a destination, to be able to:
prefetch-src
as suggested in Specify behavior of prefetch requests w3c/webappsec-csp#107The text was updated successfully, but these errors were encountered: