davsclaus opened a new pull request, #31212: URL: https://github.com/apache/camel/pull/31212
[CAMEL-28008](https://issues.apache.org/jira/browse/CAMEL-28008) When CORS is enabled in the Rest DSL with `Access-Control-Allow-Credentials=true` (`corsAllowCredentials(true)`) and `Access-Control-Allow-Origin` is left at its default `*`, `RestBindingAdvice` answered with the `Origin` of the request together with `Access-Control-Allow-Credentials=true`. Credentials are now only allowed for an origin that is configured, as `platform-http-vertx`, `camel-jetty`, `camel-cometd` (CAMEL-25984) and `camel-a2a` already do: - With the origin `*`, the response keeps `Access-Control-Allow-Origin: *` and leaves out `Access-Control-Allow-Credentials`. - A WARN is logged once per CamelContext when the rest routes are created. - With a configured origin, such as `corsHeaderProperty("Access-Control-Allow-Origin", "https://app.example.com")`, credentials are allowed as before. Tests: `FromRestGetCorsAllowCredentialsTest` now expects no credentials with the default origin, and the new `FromRestGetCorsAllowCredentialsWithOriginTest` checks a configured origin. The CORS and rest binding tests of camel-core pass. Docs: the CORS section of `rest-dsl-binding.adoc` says how to allow credentials, and the 4.25 upgrade guide has an entry. _Claude Code on behalf of davsclaus_ 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_012nJsFsjqqFiwroeHRWaKbS -- 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]
