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

JSON response for too short prefix #925

Open
pohlm01 opened this issue Jan 16, 2024 · 0 comments
Open

JSON response for too short prefix #925

pohlm01 opened this issue Jan 16, 2024 · 0 comments

Comments

@pohlm01
Copy link

pohlm01 commented Jan 16, 2024

The Routinator API currently returns a plaintext response Bad Request together with the HTTP status 400 Bad Request in case the requested prefix is too short. See for example https://routinator.do.nlnetlabs.nl/api/v1/validity/AS15169/104.154.0.0/14.

It would be great to have a more explanatory error response, preferably in JSON format, such that a helpful error message can be displayed to the user in the UI. The HTTP status code should stay an error code, e.g., 400 Bad Request, in my opinion.

Additionally, the API currently does not send any CORS-headers in case of this failure. Therefore, we end up with an CORS-error in the browser logs. This is probably not directly connected to Routinator, but more to the deployment. Either way, having the headers set correctly, is required to read out the new JSON error response.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant