Skip to content

bug: It should return 400 when update consumer with mismatched username in path and body #4680

Description

@liuxiran

Issue description

Environment

Bug report without environment information will be ignored or closed.

  • apisix version (cmd: apisix version): 2.7
  • OS (cmd: uname -a): Darwin Kernel Version 20.3.0
  • OpenResty / Nginx version (cmd: nginx -V or openresty -V): openresty/1.19.3.1
  • etcd version, if have (cmd: run curl http://127.0.0.1:9090/v1/server_info to get the info from server-info API): 3.4.0
  • apisix-dashboard version, if have: NAN
  • luarocks version, if the issue is about installation (cmd: luarocks --version): NAN

Minimal test code / Steps to reproduce the issue

Bug report without steps to reproduce will be ignored or closed.

  1. I have a consumer, username is user
    image

  2. when I update this consumer by admin-api used mismatched username in path and body, update successfully

image

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

What's the expected result?

IMO it should return HTTP code 400 when call admin-api to update consumer with mismatched username in path and body or user will get confused.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions