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

dnsdist: Send a 404 on unknown API path #5089

merged 1 commit into from Mar 6, 2017


Copy link

@pieterlexis pieterlexis commented Feb 27, 2017

Short description

Before, a 401 would be sent for unknown API paths due to the strict checking.


I have:

  • read the document
  • compiled and tested this code
  • included documentation (including possible behaviour changes)
  • documented the code
  • added or modified regression test(s)
  • added or modified unit test(s)
Copy link

@rgacogne rgacogne commented Feb 27, 2017

No idea why Travis failed on completely unrelated SNMP regression tests, I'll check tomorrow.

req.url.path=="/api/v1/servers/localhost/config/allow-from" ||
req.url.path=="/api/v1/servers/localhost/statistics") {
req.url.path == "/api/v1" ||
req.url.path.find("/api/v1/") == 0) {
header = req.headers.find("x-api-key");

This comment has been minimized.


rgacogne Feb 28, 2017

Just checking if the path begins with /api (or is /jsonstat) might be easier and could prevent the issue resurfacing if we ever do /api/v2 for example?

Before, a 401 would be sent for unknown API paths due to the strict
@pieterlexis pieterlexis force-pushed the pieterlexis:dnsdist-api-404 branch from d64ac0f to 00566cb Feb 28, 2017
@rgacogne rgacogne merged commit 3597951 into PowerDNS:master Mar 6, 2017
1 check passed
1 check passed
continuous-integration/travis-ci/pr The Travis CI build passed
@pieterlexis pieterlexis deleted the pieterlexis:dnsdist-api-404 branch Mar 6, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

2 participants