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 2021/07/06 14:52:00 UTC

[GitHub] [apisix] gxthrj opened a new issue #4547: bug: 404 route not found if URI contains %0A

gxthrj opened a new issue #4547:
URL: https://github.com/apache/apisix/issues/4547


   ### Issue description
   If URI contains %0A, will cause route match failed.
   
   ### Environment
   
   * apisix version (cmd: `apisix version`): 2.6
   
   ### Minimal test code / Steps to reproduce the issue
   
   Bug report without steps to reproduce will be ignored or closed.
   
   1. create a route
   ```
   curl http://127.0.0.1:9080/apisix/admin/routes/31 -H 'X-API-KEY: edd1c9f034335f136f87ad84b625c8f1' -X PUT -i -d '
   {
       "uri": "*",
       "hosts": ["foo.com"],
       "methods": ["PUT", "GET"],
       "enable_websocket": true,
       "upstream": {
           "type": "roundrobin",
           "nodes": {
               "httpbin.org": 1
           }
       }
   }'
   ```
   2. have a try with normal request
   ```
   curl -i http://127.0.0.1:9080/ip -H "Host:foo.com"
   ```
   It will be success.
   
   ```
   HTTP/1.1 200 OK
   Content-Type: application/json
   Content-Length: 45
   Connection: keep-alive
   Date: Tue, 06 Jul 2021 14:47:10 GMT
   Access-Control-Allow-Origin: *
   Access-Control-Allow-Credentials: true
   Server: APISIX/2.6
   
   {
     "origin": "172.19.0.1, 114.220.17.103"
   }
   ```
   3. If URI contains %0A
   ```
   curl -i http://127.0.0.1:9080/ip%0AVega -H "Host:foo.com"
   ```
   will get 404
   ```
   HTTP/1.1 404 Not Found
   Date: Tue, 06 Jul 2021 14:35:51 GMT
   Content-Type: text/plain; charset=utf-8
   Transfer-Encoding: chunked
   Connection: keep-alive
   Server: APISIX/2.6
   
   {"error_msg":"404 Route Not Found"}
   ```
   
   ### What's the expected result?
   Expect normal routing, and upstream returns 404
   ```
   <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
   <title>404 Not Found</title>
   <h1>Not Found</h1>
   <p>The requested URL was not found on the server.  If you entered the URL manually please check your spelling and try again.</p>
   ```


-- 
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] spacewander commented on issue #4547: bug: 404 route not found if URI contains %0A

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


   Look like it is a bug in the route match library.


-- 
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] tokers closed issue #4547: bug: 404 route not found if URI contains %0A

Posted by GitBox <gi...@apache.org>.
tokers closed issue #4547:
URL: https://github.com/apache/apisix/issues/4547


   


-- 
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] Yiyiyimu closed issue #4547: bug: 404 route not found if URI contains %0A

Posted by GitBox <gi...@apache.org>.
Yiyiyimu closed issue #4547:
URL: https://github.com/apache/apisix/issues/4547


   


-- 
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] gxthrj commented on issue #4547: bug: 404 route not found if URI contains %0A

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


   > What is the exact behavior if you access the upstream directly with this URL?
   
   It has been writen here.
   
   ![image](https://user-images.githubusercontent.com/4413028/124689692-8ab9d180-df0b-11eb-9908-866c99c5995f.png)
   


-- 
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] tokers commented on issue #4547: bug: 404 route not found if URI contains %0A

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


   > > What is the exact behavior if you access the upstream directly with this URL?
   > 
   > It has been written here.
   > 
   > ![image](https://user-images.githubusercontent.com/4413028/124689692-8ab9d180-df0b-11eb-9908-866c99c5995f.png)
   
   I mean, don't use APISIX as the proxy.


-- 
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] gxthrj commented on issue #4547: bug: 404 route not found if URI contains %0A

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


   > Look like it is a bug in the route match library.
   
   Yep


-- 
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] gxthrj edited a comment on issue #4547: bug: 404 route not found if URI contains %0A

Posted by GitBox <gi...@apache.org>.
gxthrj edited a comment on issue #4547:
URL: https://github.com/apache/apisix/issues/4547#issuecomment-875214551


   > What is the exact behavior if you access the upstream directly with this URL?
   
   It has been written here.
   
   ![image](https://user-images.githubusercontent.com/4413028/124689692-8ab9d180-df0b-11eb-9908-866c99c5995f.png)
   


-- 
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] tokers commented on issue #4547: bug: 404 route not found if URI contains %0A

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


   What is the exact behavior if you access the upstream directly with this URL?


-- 
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] Yiyiyimu commented on issue #4547: bug: 404 route not found if URI contains %0A

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


   need to use new version before closing this issue. my bad


-- 
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] membphis commented on issue #4547: bug: 404 route not found if URI contains %0A

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


   fixed: https://github.com/api7/lua-resty-radixtree/pull/99
   


-- 
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] JanLi-air commented on issue #4547: bug: 404 route not found if URI contains %0A

Posted by GitBox <gi...@apache.org>.
JanLi-air commented on issue #4547:
URL: https://github.com/apache/apisix/issues/4547#issuecomment-875440888


   Is there an easy fix for this? When can we expect a fix?


-- 
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] gxthrj commented on issue #4547: bug: 404 route not found if URI contains %0A

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


   > > > What is the exact behavior if you access the upstream directly with this URL?
   > > 
   > > 
   > > It has been written here.
   > > ![image](https://user-images.githubusercontent.com/4413028/124689692-8ab9d180-df0b-11eb-9908-866c99c5995f.png)
   > 
   > I mean, don't use APISIX as the proxy.
   
   Using Nginx, it will return from upstream. Because the location is '*'.


-- 
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] gxthrj commented on issue #4547: bug: 404 route not found if URI contains %0A

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


   Great~


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