oscerd opened a new pull request, #28555: URL: https://github.com/apache/camel/pull/28555
CometD endpoints in `camel-cometd` accept transport connections through the CometD `BayeuxServer`. By default, CometD registers all transports available on its classpath, which historically included `callback-polling` (JSONP) in addition to `websocket` and `long-polling`. This change introduces an `allowedTransports` configuration option on `CometdEndpoint` (and forwarded to the servlet init parameters in `CometdComponent`), defaulting to `"websocket,long-polling"`. As a result, `callback-polling` is disabled by default. ## Changes - Added `allowedTransports` URI option to `CometdEndpoint` (default: `"websocket,long-polling"`). - In `CometdComponent.createServletForConnector()`, passed `allowedTransports` as an init parameter to `org.cometd.bayeux.server.BayeuxServer.allowedTransports`, which CometD uses to initialize its active server transports. - Generated endpoint configurers, URI factory, and catalog descriptors. - Added upgrade guide documentation noting the change in default active transports and showing how to re-enable `callback-polling` if needed for legacy environments. ## Tests Added `CometdAllowedTransportsTest` covering: - `testDefaultTransportsRejectsJsonp`: verifies that handshake requests with `callback-polling` (JSONP) transport are rejected by default. - `testDefaultTransportsAllowsLongPolling`: verifies that handshake requests with standard `long-polling` transport continue to be accepted. - `testCustomTransportsAllowsJsonpWhenConfigured`: verifies that explicitly configuring `allowedTransports=websocket,long-polling,callback-polling` restores support for `callback-polling`. All 35 unit tests in `camel-cometd` pass cleanly. ## Documentation Documented under the Camel 4.24 migration notes in `docs/user-manual/modules/ROOT/pages/camel-4x-upgrade-guide-4_24.adoc`. _Claude Code on behalf of oscerd_ 🤖 Generated with [Claude Code](https://claude.com/claude-code) -- 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]
