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/09/01 06:39:06 UTC

[GitHub] [apisix] biubiue opened a new issue, #7838: bug: url contains Chinese, will decode utf8 encoded url into hexadecimal format of \x

biubiue opened a new issue, #7838:
URL: https://github.com/apache/apisix/issues/7838

   ### Current Behavior
   
   raw url: https://xxx.com/a/中文.html
   url will encode this: https://xxx.com/a/%E4%B8%AD%E6%96%87.html
   fact in apisix:  https://xxx.com/a/\xE4\xB8\xAD\xE6\x96\x87.html
   
   ### Expected Behavior
   
   _No response_
   
   ### Error Logs
   
   _No response_
   
   ### Steps to Reproduce
   
   raw url: https://xxx.com/a/中文.html
   url will encode this: https://xxx.com/a/%E4%B8%AD%E6%96%87.html
   fact in apisix:  https://xxx.com/a/\xE4\xB8\xAD\xE6\x96\x87.html
   
   ### Environment
   
   - APISIX version (run `apisix version`):2.15
   - Operating system (run `uname -a`):
   - OpenResty / Nginx version (run `openresty -V` or `nginx -V`):
   - etcd version, if relevant (run `curl http://127.0.0.1:9090/v1/server_info`):
   - APISIX Dashboard version, if relevant:
   - Plugin runner version, for issues related to plugin runners:
   - LuaRocks version, for installation issues (run `luarocks --version`):
   


-- 
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.apache.org

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


[GitHub] [apisix] github-actions[bot] commented on issue #7838: request help: url contains Chinese, will decode utf8 encoded url into hexadecimal format of \x

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on issue #7838:
URL: https://github.com/apache/apisix/issues/7838#issuecomment-1727391276

   Due to lack of the reporter's response this issue has been labeled with "no response". It will be close in 3 days if no further activity occurs. If this issue is still relevant, please simply write any comment. Even if closed, you can still revive the issue at any time or discuss it on the dev@apisix.apache.org list. Thank you for your contributions.


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


[GitHub] [apisix] biubiue commented on issue #7838: bug: url contains Chinese, will decode utf8 encoded url into hexadecimal format of \x

Posted by GitBox <gi...@apache.org>.
biubiue commented on issue #7838:
URL: https://github.com/apache/apisix/issues/7838#issuecomment-1241447729

   > #7401 Does this feature will help?
   
    I set `proxy-rewrite.use_real_request_uri_unsafe=true` in global by Apisix dashboard, not work


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


[GitHub] [apisix] monkeyDluffy6017 commented on issue #7838: bug: url contains Chinese, will decode utf8 encoded url into hexadecimal format of \x

Posted by GitBox <gi...@apache.org>.
monkeyDluffy6017 commented on issue #7838:
URL: https://github.com/apache/apisix/issues/7838#issuecomment-1241686455

   request APISIX
   ```
   curl -i -X GET "http://127.0.0.1:9080/%25E4%25B8%25AD%25E6%2596%2587/foo?arg=10"
   HTTP/1.1 200 OK
   Content-Type: application/octet-stream
   Transfer-Encoding: chunked
   Connection: keep-alive
   Date: Fri, 09 Sep 2022 08:37:46 GMT
   Server: APISIX/2.15.0   
   ```
   upstream nginx log:
   ```
   ==> logs/access.log <==
   127.0.0.1 - - [09/Sep/2022:16:37:46 +0800] "GET /%25E4%25B8%25AD%25E6%2596%2587/foo?arg=10 HTTP/1.1" 200 35 "-" "curl/7.58.0"
   ```
   
   APISIX will not change your URL,  it just forward your URL if you don't use any plugin.
   
   So where is the problem?
   
   Many web server, like nginx, it will decode the url-encoded URL before match the route.
   
   So I guess you could encoded your URL twice like the example above.
   
   


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


[GitHub] [apisix] github-actions[bot] commented on issue #7838: request help: url contains Chinese, will decode utf8 encoded url into hexadecimal format of \x

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on issue #7838:
URL: https://github.com/apache/apisix/issues/7838#issuecomment-1732271757

   This issue has been closed due to lack of activity. If you think that is incorrect, or the issue requires additional review, you can revive the issue at any time.


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


[GitHub] [apisix] github-actions[bot] closed issue #7838: request help: url contains Chinese, will decode utf8 encoded url into hexadecimal format of \x

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] closed issue #7838: request help: url contains Chinese, will decode utf8 encoded url into hexadecimal format of \x
URL: https://github.com/apache/apisix/issues/7838


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


[GitHub] [apisix] biubiue commented on issue #7838: bug: url contains Chinese, will decode utf8 encoded url into hexadecimal format of \x

Posted by GitBox <gi...@apache.org>.
biubiue commented on issue #7838:
URL: https://github.com/apache/apisix/issues/7838#issuecomment-1241444217

   > ```
   > curl "http://127.0.0.1:9080/apisix/admin/routes/1" -H "X-API-KEY: edd1c9f034335f136f87ad84b625c8f1" -X PUT -d '
   > {
   >   "methods": ["GET"],
   >   "host": "example.com",
   >   "uri": "/中文/*",
   >   "upstream": {
   >     "type": "roundrobin",
   >     "nodes": {
   >       "httpbin.org:80": 1
   >     }
   >   }
   > }'
   > 
   > curl -i -X GET "http://127.0.0.1:9080/中文/foo?arg=10" -H "Host: [example.com](http://example.com/)
   > curl -i -X GET "http://127.0.0.1:9080/%E4%B8%AD%E6%96%87/foo?arg=10" -H "Host: [example.com](http://example.com/)"
   > ```
   > 
   > I test with the above test case, and both successfully match the route. Could you tell me how i reproduce the problem?
   
   Em...   Match route is ok. I want to say ,  when url contains Chinese  ,upstream will recevie hex ,like this `\xE4\xB8\xAD\xE6\x96\x87`


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


[GitHub] [apisix] monkeyDluffy6017 commented on issue #7838: bug: url contains Chinese, will decode utf8 encoded url into hexadecimal format of \x

Posted by GitBox <gi...@apache.org>.
monkeyDluffy6017 commented on issue #7838:
URL: https://github.com/apache/apisix/issues/7838#issuecomment-1241445064

   https://github.com/apache/apisix/pull/7401


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


[GitHub] [apisix] monkeyDluffy6017 commented on issue #7838: bug: url contains Chinese, will decode utf8 encoded url into hexadecimal format of \x

Posted by GitBox <gi...@apache.org>.
monkeyDluffy6017 commented on issue #7838:
URL: https://github.com/apache/apisix/issues/7838#issuecomment-1241438009

   ```
   curl "http://127.0.0.1:9080/apisix/admin/routes/1" -H "X-API-KEY: edd1c9f034335f136f87ad84b625c8f1" -X PUT -d '
   {
     "methods": ["GET"],
     "host": "[example.com](http://example.com/)",
     "uri": "/中文/*",
     "upstream": {
       "type": "roundrobin",
       "nodes": {
         "[httpbin.org:80](http://httpbin.org/)": 1
       }
     }
   }'
   
   curl -i -X GET "http://127.0.0.1:9080/中文/foo?arg=10" -H "Host: [example.com](http://example.com/)
   curl -i -X GET "http://127.0.0.1:9080/%E4%B8%AD%E6%96%87/foo?arg=10" -H "Host: [example.com](http://example.com/)"
   ```
   I test with the above test case, and both successfully match the route.
   Could you tell me how i reproduce the problem?
   


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


[GitHub] [apisix] shreemaan-abhishek commented on issue #7838: request help: url contains Chinese, will decode utf8 encoded url into hexadecimal format of \x

Posted by "shreemaan-abhishek (via GitHub)" <gi...@apache.org>.
shreemaan-abhishek commented on issue #7838:
URL: https://github.com/apache/apisix/issues/7838#issuecomment-1707741939

   @biubiue any updates? If not, please close this issue. Thanks.


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