Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions py/visdom/utils/server_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,9 @@ def _check_auth(handler, *args, **kwargs):
# TODO this should call a shared method of the handler
handler.last_access = time.time()
if handler.login_enabled and not handler.current_user:
handler.set_status(400)
return
handler.set_status(401)
handler.write({"error": "Authentication required"})
Comment on lines +56 to +57
Copy link
Contributor

Choose a reason for hiding this comment

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

issue (bug_risk): The indentation on these new lines is inconsistent with the surrounding block and may cause an IndentationError.

The new lines under if handler.login_enabled and not handler.current_user: have one fewer leading space than the original ones. In Python, that mismatch within the same block can raise an IndentationError. Please align the indentation of the new set_status, write, and return lines exactly with the original ones.

return
f(handler, *args, **kwargs)

return _check_auth
Expand Down