From ad8c9792aa23026e720300d138c1dae6adfadcf1 Mon Sep 17 00:00:00 2001 From: Joe Kemp Date: Thu, 21 Apr 2016 13:33:16 +0000 Subject: [PATCH 1/2] Purge TCP receive buffer on auth failure --- flask_httpauth.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/flask_httpauth.py b/flask_httpauth.py index 5cfcf40..94d7619 100644 --- a/flask_httpauth.py +++ b/flask_httpauth.py @@ -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 From f3cb9af1609fecbcc87af3b33fdcd5f12fdd4905 Mon Sep 17 00:00:00 2001 From: Joe Kemp Date: Thu, 21 Apr 2016 14:19:24 +0000 Subject: [PATCH 2/2] Fix comment --- flask_httpauth.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/flask_httpauth.py b/flask_httpauth.py index 94d7619..55ec468 100644 --- a/flask_httpauth.py +++ b/flask_httpauth.py @@ -84,7 +84,7 @@ def decorated(*args, **kwargs): else: password = None if not self.authenticate(auth, password): - #Clear TCP receive buffer of any pending data + # Clear TCP receive buffer of any pending data request.data return self.auth_error_callback()