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

Make http-equiv Accept-CH non-persistent #24

Merged
merged 1 commit into from
Apr 29, 2020

Conversation

yoavweiss
Copy link
Collaborator

Closes #21

@yoavweiss yoavweiss requested a review from eeeps April 27, 2020 09:10
@yoavweiss
Copy link
Collaborator Author

/TBR @morlovich

@eeeps
Copy link
Collaborator

eeeps commented Apr 28, 2020

I can't say I understand the renderer trust issues, but I, uh, trust you when you say this solves them. If it does, this seems like a simple-enough change. The main issue, for me, is author confusion, now that two different Accept-CHs have different effects.

Zooming out from this change - is the dynamic nature of pragmas a problem? IIUC, one of the reasons the CSP pragmas are considered a mistake is that when scripts start adding/modifying them, things get weird. For instance:

  • what happens if the is processed after a request has already been initiated? I'm assuming it can only affect requests that happen after it's processed; are there situations where this may be racy or otherwise confusing to authors?
  • the algorithm in this spec allows new hints to be opted into; it does not seem to allow existing hints to be opted-out of. I can't think of any use cases for using to opt out, but I can see an author being confused as to why extra headers, not in their , are being sent (because they were already in the Accept-CH cache for that origin, for whatever reason)

Also, I left a comment about whether or not this solves my bigger issue (3P subresource client hints needing some kind of header) on #21.

@yoavweiss
Copy link
Collaborator Author

The main issue, for me, is author confusion, now that two different Accept-CHs have different effects.

I agree that's not ideal. I'm hoping that "headers are persistent, http-equiv only impacts the current page" is a simple-enough message to get across.

  • what happens if the is processed after a request has already been initiated? I'm assuming it can only affect requests that happen after it's processed; are there situations where this may be racy or otherwise confusing to authors?

If you're setting http-equiv in script, that certainly can be racy, pretty much by definition. The only way to remove that raciness is to remove http-equiv support.

  • the algorithm in this spec allows new hints to be opted into; it does not seem to allow existing hints to be opted-out of. I can't think of any use cases for using to opt out, but I can see an author being confused as to why extra headers, not in their , are being sent (because they were already in the Accept-CH cache for that origin, for whatever reason)

Yeah, http-equiv won't enable opt-out. For overriding previously set hints, one would need to use headers.
If we would see this resulting in developer confusion, maybe we could add console logs in cases where we have a mix of persistent and document-only hints.

Copy link

@morlovich morlovich left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@yoavweiss yoavweiss merged commit 0568e9d into master Apr 29, 2020
@yoavweiss yoavweiss deleted the http_equiv_does_not_persist branch April 29, 2020 05:00
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

Successfully merging this pull request may close these issues.

Reconsider http-equiv support
3 participants