html icon indicating copy to clipboard operation
html copied to clipboard

Allow custom HTTP headers to be defined for a preload request

Open yoavweiss opened this issue 2 years ago • 5 comments

Continuation of https://github.com/w3c/preload/issues/157

yoavweiss avatar May 04 '22 06:05 yoavweiss

Please correct me if I'm wrong but this seems especially crucial with planned browser changes to block third-party cookies. Many apps which are embedded in third-party contexts will likely deal with the third-party cookie changes by switching to HTTP headers for authentication. As a result, those apps will lose the ability to preload critical fetch resources which require authentication.

jimmydief avatar Jun 22 '22 19:06 jimmydief

I can't "thumbsup" the archived repo, so I'd like to reiterate this comment about using the type attribute to set Accept. It would certainly work for my use-case, though I can see how this would be a potentially breaking change.

nate-at-gusto avatar Jul 21 '22 17:07 nate-at-gusto

In general for preloads, the as attribute would mean the browser uses the Accept header typically used for the related destination. That won't help you create an Accept: application/json request header though.

yoavweiss avatar Jul 22 '22 11:07 yoavweiss

If I'm reading Noam's comment here: https://bugs.chromium.org/p/chromium/issues/detail?id=1072144#c18 correctly, I think the underlying issue ("accept header causing preload not be accepted") is resolved?

nate-at-gusto avatar Jul 27 '22 17:07 nate-at-gusto

If I understand correctly, the change removed checking of the Accept header when matching the cached entry. So, it makes the error go away, but doesn't let you do content negotiation when preloading.

zcorpan avatar Aug 09 '22 10:08 zcorpan

Related: https://bugs.chromium.org/p/chromium/issues/detail?id=1415291

mitar avatar Feb 13 '23 11:02 mitar