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

   [CAMEL-26485](https://issues.apache.org/jira/browse/CAMEL-26485): the 
`netty-http` producer no longer sends its own endpoint options to the HTTP 
server as query parameters.
   
   With 
`netty-http:http://localhost:8080/foo?bar=1&cookieHandler=#myCookieHandler&httpMethodRestrict=GET`,
 the server received `bar=1&cookieHandler=...&httpMethodRestrict=GET`. Now it 
receives only `bar=1`, as the documentation ("Query parameters vs. endpoint 
options") describes.
   
   ## Cause
   
   `NettyHttpComponent.createEndpoint` built the HTTP address from the 
parameters before `setProperties(answer, parameters)`, which binds the 
endpoint's own options and removes them. So those options stayed in the address:
   - Seen in the test: `cookieHandler`, `httpMethodRestrict`, `traceEnabled` 
and `exchangePattern`.
   - From the code: `exceptionHandler` and `oauthProfile` too.
   
   Options of `NettyHttpConfiguration` were not affected, because 
`parseConfiguration` already removed them.
   
   ## Fix
   
   The address URI is built after the endpoint options are bound, as 
camel-http's `HttpComponent` does. The split from CAMEL-26487 stays: the 
endpoint URI carries all the options, and the address URI is what gets called. 
Endpoints that differ only in an option, such as two Rest DSL consumers on one 
path with GET and POST, remain separate endpoints.
   
   Upgrade guide (4.24): a note next to the CAMEL-26487 entry. A query 
parameter that has the same name as an endpoint option can be sent with the 
`CamelHttpQuery` header.
   
   ## Tests
   
   New `NettyHttpEndpointOptionsNotInQueryTest`:
   - With a real query parameter and several options, the options are bound to 
the endpoint, and an echo consumer receives exactly `bar=1`.
   - With only options, the server receives no query.
   - Rest DSL GET and POST on one path are two endpoints, and both answer.
   
   The first two fail without the fix. The camel-netty-http module passes: 377 
tests, 0 failures, 10 skipped. `NettyHttpEndpointDifferentOptionsTest` 
(CAMEL-26487) still passes.
   
   _Claude Code on behalf of davsclaus_
   
   🤖 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]

Reply via email to