You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@apisix.apache.org by GitBox <gi...@apache.org> on 2022/01/04 06:07:57 UTC

[GitHub] [apisix] ting-xu commented on issue #5654: bug: URI encoding issue

ting-xu commented on issue #5654:
URL: https://github.com/apache/apisix/issues/5654#issuecomment-1004550815


   > ok, I've had a look around and I don't think it's a bug.
   > 
   > Nginx will escape the `" ", "#", "%", "&", "+", "?"` and the `%00-%1F` and `%7F-%FF` to follow rfc3986#section-2.2.
   > 
   > so I recommend not using %3C in the uri.
   > 
   > refer to: https://juejin.cn/post/6844903512485134343#heading-5
   > 
   > cc @tokers
   
   > 
   > No this is not, we already managed to strip the route prefix by using the regex.
   > 
   > The issue is the gateway server decoding the route and not encoding it again, what I want is when submitting this request `$curl http://127.0.0.1:9080/api/groups/%3CNumber%3E`
   > 
   > I need to get this
   > 
   > `uri: /groups/%3CNumber%3E`
   > 
   > NOT that: `uri: /groups/<Number>`
   
   I think it's a bug.
   
   I also had this issue when using apisix to route request to backend gerrit code-review server.
   The JS in browser will send request like http://gerrit.server/changes/repo-group%2Freop-name~100/detail?O=....
   when apisix forward to gerrit, it becomes http://gerrit.server/changes/repo-group/reop-name~100/detail?O=....
   cause gerrit cannot handle correctly and return 404
   
   Instead, when I use nginx to route, things are ok, the %2F is not auto decoded and keep original.
   


-- 
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: notifications-unsubscribe@apisix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org