-
Notifications
You must be signed in to change notification settings - Fork 62
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
Add ability to only return status code #113
Comments
Hey @jamesmallen, thanks for using django-watchman and suggesting this improvement. :) I was wondering if you could provide a bit more info on your use case for the anonymous vs. authenticated checks? Would you expect to use both types? I'm wondering whether a blank response would be the right way to go or if it would just be to restrict the responses to "ok: true/false" and disable the other pieces like stack traces? |
On second thought, there's a lot of ambiguity around behavior when this is introduced. I'm wondering if having another view, that can be used instead of or in addition to the default urlpatterns might be a good way of achieving our goal. We would prefer not to reveal any implementation details for the anonymous view |
I just opened a PR to implement the "bare status" endpoint. It is not part of the default To avoid code duplication, I refactored the views to use a helper function to generate the status object. Let me know if you have any thoughts or suggestions about different ways to approach this! |
Fixed by #114 |
A very useful feature for us would be the ability to have blank responses with HTTP status codes if the user is anonymous, and the normal operation if the user attempts authenticationf.
One way to do this would be to add a setting
WATCHMAN_ANONYMOUS_DETAILS
with a default value ofTrue
. I'm happy to put together a PR exploring this possibilityThe text was updated successfully, but these errors were encountered: