You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@servicecomb.apache.org by GitBox <gi...@apache.org> on 2019/05/20 08:04:18 UTC

[GitHub] [servicecomb-java-chassis] liangrongjie opened a new issue #1215: The CseClientHttpRequest automatically adds the path variable named ‘null’.

liangrongjie opened a new issue #1215: The CseClientHttpRequest automatically adds the path variable named ‘null’.
URL: https://github.com/apache/servicecomb-java-chassis/issues/1215
 
 
   When the Cse is used as the client to send a request without the path variable to other microservices, the cse automatically adds a redundant variable named "null".
   
   The original path`/v1/countries` is changed to `/v1/countries?null`.
   
   The code is in the `org.apache.servicecomb.provider.springmvc.reference.CseClientHttpRequest#prepareInvocation(Object[])`
   ```java
   invocation.getHandlerContext().put(RestConst.REST_CLIENT_REQUEST_PATH,
           path + "?" + this.uri.getRawQuery());
   ```
   
   when request path  without the path variable, the ` this.uri.getRawQuery()` return null (*not string ""*);executes the request at the `org.apache.servicecomb.transport.rest.client.http.RestClientInvocation#createRequestPath(RestOperationMeta)`   obtained incorrect path from invocation.handlerContext.
   
   ```java
   String path = (String) invocation.getHandlerContext().get(RestConst.REST_CLIENT_REQUEST_PATH);
   ```

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services