[ 
https://issues.apache.org/jira/browse/SCB-936?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16629695#comment-16629695
 ] 

ASF GitHub Bot commented on SCB-936:
------------------------------------

liubao68 commented on a change in pull request #924: [SCB-936] encode slash in 
path param
URL: 
https://github.com/apache/incubator-servicecomb-java-chassis/pull/924#discussion_r220782294
 
 

 ##########
 File path: 
integration-tests/it-consumer/src/main/java/org/apache/servicecomb/it/testcase/TestDataTypePrimitive.java
 ##########
 @@ -395,9 +390,9 @@ public void intPath_springmvc_rt() {
 
   @Test
   public void stringPath_springmvc_rt() {
-    String expect = "serviceComb";
+    String expect = "serviceComb%2FserviceComb";
     assertEquals(expect,
-        (String) 
consumersSpringmvc.getSCBRestTemplate().getForObject("/stringPath/" + expect, 
String.class));
+        consumersSpringmvc.getSCBRestTemplate().getForObject("/stringPath/" + 
expect, String.class));
 
 Review comment:
   Please reading https://en.wikipedia.org/wiki/Percent-encoding, I think we 
can add more test cases:
   1. getForObject("/root/%%EF%BF%A5%promotionID"), should return an error, 
because this is not valide URL
   2. getInf.get("%%EF%BF%A5%promotionID") should return 
"%%EF%BF%A5%promotionID", for RPC invocation, we can add a test case include 
all possible reserved characters 
   3. generally, for spring mvc: any path segment should first encoded and than 
contact to path, and the returned value is the original string. for RPC, we get 
what we send. 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


> Encoded slash '/' is decoded in EdgeService, causing 404 error response
> -----------------------------------------------------------------------
>
>                 Key: SCB-936
>                 URL: https://issues.apache.org/jira/browse/SCB-936
>             Project: Apache ServiceComb
>          Issue Type: New Feature
>            Reporter: YaoHaishi
>            Assignee: YaoHaishi
>            Priority: Major
>
> When users invoke a provider via EdgeService, and the path param of request 
> contains %2F(the encoded slash '/'), EdgeService will decode %2F into '/' and 
> pass it to backend service without encoding it, causing 404 response.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to