Fixed connection keep-alive bug for basic auth

This commit is contained in:
Sebastian Lohff 2012-11-13 02:56:50 +01:00
parent d54b3f5b8d
commit 72b561ace7
1 changed files with 5 additions and 0 deletions

View File

@ -976,6 +976,11 @@ class AuthenticationHandler():
else:
self.send_response(401)
self.send_header("WWW-Authenticate", "Basic realm=\"%s\"" % self.realm)
self.send_header("Connection", "close")
errorMsg = "<html><head><title>401 - Unauthorized</title></head><body><h1>401 - Unauthorized</h1></body></html>"
self.send_header("Content-Length", str(len(errorMsg)))
self.end_headers()
self.wfile.write(errorMsg)
def main():