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

   ## Summary
   
   - Fix `URISupport.createURIWithQuery()` to not append a bare `?` when the 
query string is empty
   - When `camel-rest-openapi` produces a REST call from an OpenAPI spec with 
optional query parameters that are not set, the URL ended with a trailing `?` 
(e.g., `/users/myuser/repos?` instead of `/users/myuser/repos`)
   - Some HTTP servers and proxies treat `/resource` and `/resource?` 
differently, so this can cause issues
   
   ## Root Cause
   
   `URISupport.createURIWithQuery()` checked `if (query != null)` before 
appending `?` + query, but did not check if the query string was empty. Changed 
to `if (query != null && !query.isEmpty())`.
   
   ## Test plan
   
   - [x] Added `testCreateURIWithQueryEmptyQueryString` in `URISupportTest` 
verifying no trailing `?` is appended for empty query strings
   - [x] Existing `URISupportTest` tests pass (null query and non-empty query 
cases)
   
   _Claude Code on behalf of Claus Ibsen_


-- 
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