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

Adding more debug information #3351

Open
wants to merge 1 commit into
base: 4.x
Choose a base branch
from
Open

Conversation

mamazu
Copy link

@mamazu mamazu commented Nov 10, 2024

What I did

I added some more debug info to the "Bad method" exception.

I also updated the tests because the tests would return the error message Method "GET" not allowed. Allowed methods: GET".

Why

When triggering an endpoint with a wrong method it correctly throws this error and shows me what methods are actually available but not what method was used to cause the exception.

@odan
Copy link
Contributor

odan commented Nov 14, 2024

I think it could be potentially dangerous to print such detailed information in error messages, especially in a production environment. It’s generally recommended to limit detailed error information to development and debugging environments only. In production, a generic message (like "Method not allowed") would be the proper way.

@mamazu
Copy link
Author

mamazu commented Nov 16, 2024

Totally agree, but if security is the point here we should probably disable the info on what methods are available on that route. But I think returning the method that was used shouldn't expose any additional info.

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

Successfully merging this pull request may close these issues.

2 participants