apisix-dashboard
apisix-dashboard copied to clipboard
bug: manager-api allows adding route with uri and uris at the same time
Bug report
Describe the bug
manager-api allows adding route with uri and uris at the same time.
Because the front end is limited, the priority of the issue is not high.
How to Reproduce
{
caseDesc: "add route with uri and uris at the same time",
Object: MangerApiExpect(t),
Method: http.MethodPut,
Path: "/apisix/admin/routes/r1",
Body: `{
"uri": "/hello_notexist",
"uris": ["/hello_notexist2","/hello"],
"upstream": {
"type": "roundrobin",
"nodes": [{
"host": "172.16.238.20",
"port": 1980,
"weight": 1
}]
}
}`,
Headers: map[string]string{"Authorization": token},
ExpectStatus: http.StatusBadRequest,
},
It should return 400, but it returned 200 and insert to the etcd.
might need to discard uri, only uris is enough,
fixed by https://github.com/apache/apisix/pull/3008