Fix password check when auth_cookie is http.cookies.Morsel.
This commit is contained in:
parent
954c4c16b0
commit
7a7c179997
1 changed files with 5 additions and 1 deletions
|
@ -116,7 +116,11 @@ class RequestHandler(http.server.BaseHTTPRequestHandler):
|
||||||
if self.auth_header == self.server.password:
|
if self.auth_header == self.server.password:
|
||||||
return True
|
return True
|
||||||
|
|
||||||
if self.server.accepted_tokens is not None and self.auth_cookie in self.server.accepted_tokens:
|
cookie = self.auth_cookie
|
||||||
|
if isinstance(cookie, http.cookies.Morsel):
|
||||||
|
cookie = cookie.value
|
||||||
|
|
||||||
|
if self.server.accepted_tokens is not None and cookie in self.server.accepted_tokens:
|
||||||
return True
|
return True
|
||||||
|
|
||||||
if self.server.accepted_ips is not None and self.remote_addr in self.server.accepted_ips:
|
if self.server.accepted_ips is not None and self.remote_addr in self.server.accepted_ips:
|
||||||
|
|
Loading…
Reference in a new issue