Merge pull request #9 from ArfyFR/patch-1

Use RFC2616 recommandation to reply 401 instead on 403 for auth_failed
This commit is contained in:
Vladimir Homutov 2016-10-10 17:46:18 +04:00 committed by GitHub
commit 06444b36f6
1 changed files with 3 additions and 1 deletions

View File

@ -114,7 +114,9 @@ class AuthHandler(BaseHTTPRequestHandler):
msg += ', login="%s"' % ctx['user']
self.log_error(msg)
self.send_response(403)
self.send_response(401)
self.send_header('WWW-Authenticate', 'Basic realm=' + ctx['realm'])
self.send_header('Cache-Control', 'no-cache')
self.end_headers()
def get_params(self):