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

Conversation

pieterlexis
Copy link
Contributor

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
Copy link
Member

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");
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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
checking.
@rgacogne rgacogne merged commit 3597951 into PowerDNS:master Mar 6, 2017
@pieterlexis pieterlexis deleted the dnsdist-api-404 branch March 6, 2017 09:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants