davsclaus commented on code in PR #27022:
URL: https://github.com/apache/camel/pull/27022#discussion_r4126513282


##########
core/camel-core-catalog/src/main/java/org/apache/camel/catalog/impl/AbstractCamelCatalog.java:
##########
@@ -1112,7 +1127,11 @@ private static String wrapRAW(String key, String val, 
Map<String, BaseOptionMode
             return val;
         }
 
-        if (option.isSecret() && !val.startsWith("#") && 
!val.startsWith("RAW(")) {
+        if (option.isSecret() && !val.startsWith("#") && 
!val.startsWith("RAW(") && !val.startsWith("RAW{")) {
+            // use RAW{} when the value contains ) as that would end RAW()
+            if (val.indexOf(')') != -1 && val.indexOf('}') == -1) {
+                return "RAW{" + val + "}";
+            }
             return "RAW(" + val + ")";

Review Comment:
   Added the note in 7cd1ddb, reworded to name where it bites: the query parser 
only ends `RAW(` at `)&` or end of value, but `URISupport.scanRaw` (used by 
`UnsafeUriCharactersEncoder`) ends at the first `)`, so a value with both `)` 
and `}` cannot be safely wrapped in either form. Also removed the double 
`componentModel(scheme)` lookup by passing the model into the private 
`validateProperties` overload.
   
   _Claude Code on behalf of davsclaus_



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