Merge pull request #13 from ArfyFR/patch-1

Quoted-string Basic realm ctx according to rfc7235
This commit is contained in:
Vladimir Homutov 2016-11-03 14:10:01 +04:00 committed by GitHub
commit b56c9ef686
1 changed files with 2 additions and 2 deletions

View File

@ -61,7 +61,7 @@ class AuthHandler(BaseHTTPRequestHandler):
if auth_header is None or not auth_header.lower().startswith('basic '):
self.send_response(401)
self.send_header('WWW-Authenticate', 'Basic realm=' + ctx['realm'])
self.send_header('WWW-Authenticate', 'Basic realm="' + ctx['realm'] + '"')
self.send_header('Cache-Control', 'no-cache')
self.end_headers()
@ -115,7 +115,7 @@ class AuthHandler(BaseHTTPRequestHandler):
self.log_error(msg)
self.send_response(401)
self.send_header('WWW-Authenticate', 'Basic realm=' + ctx['realm'])
self.send_header('WWW-Authenticate', 'Basic realm="' + ctx['realm'] + '"')
self.send_header('Cache-Control', 'no-cache')
self.end_headers()