apisix icon indicating copy to clipboard operation
apisix copied to clipboard

request help: should strengthen the verification of operators

Open idbeta opened this issue 6 years ago • 0 comments

Issue description

create with vars which operator was wrong, but APISIX still returns 200 and insert to etcd.

Environment

  • apisix version (cmd: apisix version): master
  • OS:

Minimal test code / Steps to reproduce the issue

{
			caseDesc: "add route with invalid vars (error operators)",
			Object:   MangerApiExpect(t),
			Method:   http.MethodPut,
			Path:     "/apisix/admin/routes/r1",
			Body: `{
					"uri": "/hello",
					"vars": [
						["arg_name","=","aaa"]
					],
					"upstream": {
						"type": "roundrobin",
						"nodes": [{
							"host": "172.16.238.20",
							"port": 1980,
							"weight": 1
						}]
					}
				}`,
			Headers:      map[string]string{"Authorization": token},
			ExpectStatus: http.StatusNotFound,
		},

What's the actual result? (including assertion message & call stack if applicable)

return 200, and insert the route to etcd, but it is useless.

What's the expected result?

return 400

idbeta avatar Nov 27 '20 10:11 idbeta