apisix
apisix copied to clipboard
request help: setted a special uri in route,when request it,it return 404
Issue description
$ curl http://127.0.0.1:9080/apisix/admin/routes/1 -H 'X-API-KEY: edd1c9f034335f136f87ad84b625c8f1' -X PUT -i -d '
{
"uri": "/helloh~E]ftXnj2Hs#r9&Rg:Y/;o-OI,uN7Le!P_J+w.zi4C0aDA3WMqU1T*KVZ?GmdFlQ5",
"upstream": {"nodes": {"127.0.0.1:9666": 1}, "type": "roundrobin"}
}'
HTTP/1.1 200 OK
Date: Sat, 10 Oct 2020 08:22:37 GMT
Content-Type: application/json
... ...
but when I request the URI
$ curl http://127.0.0.1:9080/helloh~E]ftXnj2Hs#r9&Rg:Y/;o-OI,uN7Le!P_J+w.zi4C0aDA3WMqU1T*KVZ?GmdFlQ5
....
# it returned 404
Environment
- apisix version (cmd:
apisix version): master - OS:
http://127.0.0.1:9080/helloh~E]ftXnj2Hs#r9&Rg:Y/;o-OI,uN7Le!P_J+w.zi4C0aDA3WMqU1T*KVZ?GmdFlQ5
it is not a valid URI address, the Admin API should return 400 for this case.
it can not contain #.
a correct test case:
$ curl http://127.0.0.1:9080/apisix/admin/routes/1 -H 'X-API-KEY: edd1c9f034335f136f87ad84b625c8f1' -X PUT -i -d '
{
"uri": "/helloh~E]ftXnj2Hs",
"upstream": {"nodes": {"127.0.0.1:9666": 1}, "type": "roundrobin"}
}'
$ curl -i 'http://127.0.0.1:9080/helloh~E%5DftXnj2Hs'
HTTP/1.1 200 Bad Gateway
Date: Sun, 11 Oct 2020 08:04:45 GMT
Content-Type: text/html; charset=utf-8
Content-Length: 154
... ...