Skip to content

Commit d456ff5

Browse files
suggestions fixed
1 parent 1023200 commit d456ff5

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

  • components/apimgt/org.wso2.carbon.apimgt.gateway/src/main/java/org/wso2/carbon/apimgt/gateway/mediators

components/apimgt/org.wso2.carbon.apimgt.gateway/src/main/java/org/wso2/carbon/apimgt/gateway/mediators/AIAPIMediator.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
import com.jayway.jsonpath.JsonPath;
2020
import com.jayway.jsonpath.PathNotFoundException;
2121
import java.net.URI;
22+
import java.net.URLDecoder;
2223
import java.nio.charset.StandardCharsets;
2324
import org.apache.axiom.om.OMElement;
2425
import org.apache.axis2.AxisFault;
@@ -482,7 +483,8 @@ private void modifyRequestPath(String model, LLMProviderMetadata targetModelMeta
482483
* @return The decoded path.
483484
*/
484485
private String decodePathUrl(String rawPath) {
485-
return java.net.URLDecoder.decode(rawPath.replace("+", "%2B"), StandardCharsets.UTF_8);
486+
// URLDecoder is for form-encoded data and converts + to space; escape + first to preserve it in paths
487+
return URLDecoder.decode(rawPath.replace("+", "%2B"), StandardCharsets.UTF_8);
486488
}
487489

488490
/**

0 commit comments

Comments
 (0)