Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bug: config route with non-existent fields should return 400 #918

Closed
idbeta opened this issue Nov 30, 2020 · 2 comments · Fixed by #986
Closed

bug: config route with non-existent fields should return 400 #918

idbeta opened this issue Nov 30, 2020 · 2 comments · Fixed by #986
Labels
backend bug Something isn't working help wanted Extra attention is needed
Milestone

Comments

@idbeta
Copy link
Contributor

idbeta commented Nov 30, 2020

Bug report

Describe the bug

config route with non-existent fields should return 400

How to Reproduce

{
	caseDesc: "config route with non-existent fields (r1)",
	Object:   MangerApiExpect(t),
	Path:     "/apisix/admin/routes/r1",
	Method:   http.MethodPut,
	Body: `{
			"uri": "/hello",
			"nonexistent": "test non-existent",
			"upstream": {
				"type": "roundrobin",
				"nodes": [{
					"host": "172.16.238.20",
					"port": 1980,
					"weight": 1
				}]
			}
		}`,
	Headers:      map[string]string{"Authorization": token},
	ExpectStatus: http.StatusBadRequest,
},

it return 200 and insert it to etcd now.

@idbeta idbeta added the bug Something isn't working label Nov 30, 2020
@moonming moonming added this to the 2.2 milestone Nov 30, 2020
@LiteSun LiteSun added the backend label Dec 1, 2020
@LiteSun
Copy link
Member

LiteSun commented Dec 1, 2020

cc @nic-chen

@membphis
Copy link
Member

membphis commented Dec 4, 2020

if we fix #955, then we should fix this issue too

@membphis membphis added the help wanted Extra attention is needed label Dec 7, 2020
@membphis membphis modified the milestones: 2.2, 2.3 Dec 11, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backend bug Something isn't working help wanted Extra attention is needed
Projects
None yet
4 participants