[
https://issues.apache.org/jira/browse/CAMEL-26169?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18136608#comment-18136608
]
Claus Ibsen commented on CAMEL-26169:
-------------------------------------
PR: https://github.com/apache/camel/pull/28945
The auth parameters are now appended with & when the url already has a query,
and the username and password are wrapped in RAW(). A test against a local http
server covers both bugs.
_Claude Code on behalf of Claus Ibsen (davsclaus)_
> camel-sap-netweaver - an endpoint url that already has a query string gets a
> second ? added
> -------------------------------------------------------------------------------------------
>
> Key: CAMEL-26169
> URL: https://issues.apache.org/jira/browse/CAMEL-26169
> Project: Camel
> Issue Type: Bug
> Reporter: Claus Ibsen
> Assignee: Claus Ibsen
> Priority: Minor
> Fix For: 4.24.0
>
>
> Found while adding the catalog body types of sap-netweaver (CAMEL-24961, PR
> #28412).
> h4. 1. An endpoint url that already has a query string gets a second ?
> {{NetWeaverProducer.doStart}} (main 2a465aa4814c, line 81) builds the http
> endpoint uri as {{getUrl() + "?authUsername=" + ...}}, always with a {{?}}.
> When the configured url already has query parameters, the result has two
> {{?}} and the http endpoint gets a wrong uri. Read in the code, not run.
> Proposed: append the parameters with {{&}} when the url already contains
> {{?}} (for example with {{URISupport.appendParametersToURI}}).
> h4. 2. A password with & or + fails
> {{NetWeaverProducer}} (main 2a465aa4814c, line 81) builds the http endpoint
> URI as {{url + "?authUsername=" + username + "&authPassword=" + password}},
> without {{RAW()}} or encoding. A password with {{&}} is cut there (with
> {{RAW(a&b=c)}} the server got the Basic credentials {{u:a}}, and {{b=c}} in
> the request query), and a {{+}} becomes a space. Checked on 4.24.0-SNAPSHOT
> with a local HTTP server.
> Proposed: wrap the values in {{RAW()}}, or set the auth options on the http
> endpoint instead of building them into the URI.
> _Claude Code on behalf of davsclaus_
--
This message was sent by Atlassian Jira
(v10.3.26#10030026)