Repository navigation
Issue #15096 CrossOriginHandler not returning valid headers when all headers are allowed - #15418
Open
kamilkrzywanski wants to merge 1 commit into
Conversation
kamilkrzywanski
force-pushed
the
fix/jetty-12.1.x/15096-cross-origin-allow-headers
branch
2 times, most recently
from
July 12, 2026 11:00
b376355 to
c0c27c4
Compare
… all headers are allowed With allowedHeaders=*, preflight was always answering Access-Control-Allow-Headers: *. That is not valid when credentials are enabled; browsers reject the preflight. Reflect Access-Control-Request-Headers instead, same as the old CrossOriginFilter. Signed-off-by: Kamil Krzywanski <kamilkrzywanski01@gmail.com>
kamilkrzywanski
force-pushed
the
fix/jetty-12.1.x/15096-cross-origin-allow-headers
branch
from
November 1, 2026 09:03
c0c27c4 to
befa0d0
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #15096
If you set
allowedHeaders=*onCrossOriginHandlerwith credentials enabled, preflight responses come back withAccess-Control-Allow-Headers: *. That is not valid for credentialed CORS requests, so browsers fail the preflight. The oldCrossOriginFilteralready reflectedAccess-Control-Request-Headersin this case.This makes
CrossOriginHandlerdo the same: when allowed headers are*, echo the requested headers on the preflight response. Explicit header lists are unchanged.Updated
testPreflightWithWildcardCustomHeadersto check the reflected value instead of only that the header is present.