mirror of
https://github.com/nginxinc/nginx-ldap-auth.git
synced 2026-09-29 19:11:28 +02:00
Fix for Python3
This commit is contained in:
@@ -74,7 +74,7 @@ class AppHandler(BaseHTTPRequestHandler):
|
||||
<tr>
|
||||
<td>Username: <input type="text" name="username"/></td>
|
||||
<tr>
|
||||
<td>Password: <input type="text" name="password"/></td>
|
||||
<td>Password: <input type="password" name="password"/></td>
|
||||
<tr>
|
||||
<td><input type="submit" value="Login"></td>
|
||||
</table>
|
||||
@@ -119,6 +119,8 @@ class AppHandler(BaseHTTPRequestHandler):
|
||||
#
|
||||
# WARNING WARNING WARNING
|
||||
enc = base64.b64encode(ensure_bytes(user + ':' + passwd))
|
||||
if sys.version_info.major == 3:
|
||||
enc = enc.decode()
|
||||
self.send_header('Set-Cookie', b'nginxauth=' + enc + b'; httponly')
|
||||
|
||||
self.send_header('Location', target)
|
||||
|
||||
Reference in New Issue
Block a user