oscerd opened a new pull request, #25820:
URL: https://github.com/apache/camel/pull/25820

   Fixes [CAMEL-24436](https://issues.apache.org/jira/browse/CAMEL-24436).
   
   createCorsHandler() set Access-Control-Allow-Credentials: true outside the 
origin
   check, so it went out on every response to a request carrying an Origin 
header -
   including responses to origins the handler had just decided not to allow. 
And when
   camel.server.cors.origins is unset, allowsOrigin is true for every origin 
and the
   caller's own Origin is echoed back as Access-Control-Allow-Origin. Together 
those
   produce the credentialed any-origin configuration the fetch specification 
refuses to
   express as "*", which is why reflecting the origin is the usual way around 
that rule.
   
   Send Access-Control-Allow-Credentials only when the request origin matched 
an origin
   the operator actually configured. With no origin list the origin is still 
reflected,
   as before, but credentials are not granted. Also add Vary: Origin whenever 
the origin
   is reflected, so a shared cache cannot serve one origin's response to 
another.
   
   Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
   Signed-off-by: Andrea Cosentino <[email protected]>
   \n## Verification\n\n3 files changed, including 1 test file(s). Module build 
with \`-am\` is green on current main, no generated-file drift. Verified 
against the pre-fix code when the change was written.
   
   _Claude Code on behalf of oscerd_


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to