apisix
apisix copied to clipboard
bug: admin api matches config ID by prefix
Issue description
Admin api appears to match config Id by prefix instead of an exact string match.
Environment
- apisix version (cmd:
apisix version): 2.0 - OS: osx + linux
Minimal test code / Steps to reproduce the issue
- PUT a new upstream with id: abc
- GET upstream by id: ab
What's the actual result? (including assertion message & call stack if applicable)
The upstream abc is returned.
What's the expected result?
A NOT_FOUND is expected here
It's very critical, should take priority to fix this.
Suppose this case:
- Put a upstream with id foobar.
- Put a route which refers to upstream foo.
- Instead of reporting an error that the second step refers to a non-exist upstream, the route is put successfully with upstream foobar.
It is indeed a problem, thanks for the feedback.