apisix-dashboard icon indicating copy to clipboard operation
apisix-dashboard copied to clipboard

bug: manager-api allows adding route with uri and uris at the same time

Open idbeta opened this issue 6 years ago • 2 comments

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.

idbeta avatar Nov 27 '20 02:11 idbeta

might need to discard uri, only uris is enough,

lilien1010 avatar Nov 27 '20 02:11 lilien1010

fixed by https://github.com/apache/apisix/pull/3008

nic-chen avatar Jan 21 '21 07:01 nic-chen