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
merged 1 commit into from Mar 6, 2017

Conversation

Projects
None yet
2 participants
@pieterlexis
Member

pieterlexis commented Feb 27, 2017

Short description

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

Checklist

I have:

  • read the CONTRIBUTING.md 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)

@rgacogne rgacogne added the dnsdist label Feb 27, 2017

@rgacogne

This comment has been minimized.

Member

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

rgacogne Feb 28, 2017

Member

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?

dnsdist: Send a 404 on unknown API path
Before, a 401 would be sent for unknown API paths due to the strict
checking.

@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

continuous-integration/travis-ci/pr The Travis CI build passed
Details

@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