Skip to content

Commit

Permalink
Fix TCP Connection reset by peer error (#39)
Browse files Browse the repository at this point in the history
Purge TCP receive buffer on auth failure
  • Loading branch information
jkemp101 authored and miguelgrinberg committed Apr 21, 2016
1 parent 9da7d90 commit 94f6c6d
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions flask_httpauth.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,10 @@ def decorated(*args, **kwargs):
else:
password = None
if not self.authenticate(auth, password):
# Clear TCP receive buffer of any pending data
request.data
return self.auth_error_callback()

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

Expand Down

0 comments on commit 94f6c6d

Please sign in to comment.