| Summary: | Safari reuses Authorization header on second call to 301 redirects even if the header value changed when replaying the request | ||
|---|---|---|---|
| Product: | WebKit | Reporter: | Santiago Saavedra <info+webkit> |
| Component: | Page Loading | Assignee: | youenn fablet <youennf> |
| Status: | RESOLVED FIXED | ||
| Severity: | Normal | CC: | achristensen, annevk, beidson, cdumez, rreno, webkit-bug-importer, youennf |
| Priority: | P2 | Keywords: | InRadar |
| Version: | Safari 16 | ||
| Hardware: | All | ||
| OS: | Unspecified | ||
|
Description
Santiago Saavedra
2022-11-03 04:00:43 PDT
I strongly suspect bug 230935 is related. @Santiago, do you have a repro case? I guess you are using non basic authentication scheme? @youenn the app where this is happening to us is confidential, but I have put together this test scenario on the public domain for replicability :-) https://github.com/ssaavedra/webkit-repro-247418 Pull request: https://github.com/WebKit/WebKit/pull/6510 Thanks Santiago, the repro case helped a lot. Really pleased at how much more succint you made your test case than mine, sorry I couldn't commit more time to minimizing my repro case further :) Thank you so much for putting the PR together! On a separate note: I haven't tested this but would the behavior still be compliant if the header was named anything other than Authorization? (E.g., some X-API-Key-Header) I'm just curious about whether Authorization has some specific deeper meaning in the CFNetwork/WebKit codebase than any other header/s. Thanks again! > I haven't tested this but would the behavior still be compliant if the
> header was named anything other than Authorization? (E.g., some
> X-API-Key-Header)
Some headers need to be dropped. Authorisation in case of cross origin redirection.
Content-Type in case of 303 also.
@Anne, maybe that is something that should be more explicit in the fetch spec?
For other application specific headers, it is true they should probably be cloned from the original request.
We have the concept of originalRequestHeaders, these are the ones we should probably always copy.
I filed https://bugs.webkit.org/show_bug.cgi?id=247942 to keep track of this. Committed 256726@main (63145fa91bb8): <https://commits.webkit.org/256726@main> Reviewed commits have been landed. Closing PR #6510 and removing active labels. |