apisix
apisix copied to clipboard
bug: return `400` for invalid uri `/hello-_~!*();:@&=+$,/[]` in route
Issue description
I have a strange idea about uri, so I tested it, but it didn't work, pls help me out
$ curl http://127.0.0.1:9080/apisix/admin/routes/1 -H 'X-API-KEY: edd1c9f034335f136f87ad84b625c8f1' -X PUT -i -d '{
"uri": "/hello-_~!*();:@&=+$,/[]",
"upstream": {"nodes": {"127.0.0.1:9666": 1}, "type": "roundrobin"}}'
HTTP/1.1 200 OK
... ...
test route
$ curl -i 'http://127.0.0.1:9080/hello-_~%21%2a%28%29%3b%3a%40%26%3d%2b%24%2c/%5b%5d'
HTTP/1.1 404 Not Found
... ...
test the original address
$ curl -i 'http://127.0.0.1:9666/hello-_~%21%2a%28%29%3b%3a%40%26%3d%2b%24%2c/%5b%5d'
HTTP/1.1 200 OK
... ..
Environment
- apisix version (cmd:
apisix version): master - OS: macos
ping @membphis
"uri": "/hello-_~!*();:@&=+$,/[]",
that is an invalid path for APISIX. the * mainly use for prefix matching.
the admin API should return 400 for this case.
here is the link of the APISIX router: https://github.com/api7/lua-resty-radixtree#prefix-match