-
Notifications
You must be signed in to change notification settings - Fork 31
Allow HTTP headers to be defined for a preload request #157
Comments
/cc @annevk |
Ideally this follows from the destination (i.e., the |
@annevk - The destination determines the default |
I see. I recall some prior discussion about trying to figure out how to put |
Maybe the It's not a complete solution, but the accept header seems to be the source of most issues. I can't prefetch anything, because I'll get XML if I don't provide a custom accept header |
Discussion continues at whatwg/html#7887 |
The preload hints don't currently work if a SPA client makes an HTTP request via
fetch
orXHR
apis to the server and in this request it specifies e.g. anAccept
header in order to negotiate the format of the response.A typical symptom of this issue is a warning about the preload request mismatch due to incompatible headers:
The root cause analysis in angular/angular#34899 (comment) revealed that the issue is indeed setting the
Accept
header.Using the Accept header for content negotiation is a relatively common thing in the REST api design: https://restfulapi.net/content-negotiation/ as it allows a server to support multiple response formats using the same URL space.
It would be great if it was possible to specify the
Accept
header (and potentially other headers as well?) when configuring the preload hint to enable prefetching requests from servers that do use the Accept header for content negotiation.The text was updated successfully, but these errors were encountered: