Show More
@@ -179,13 +179,13 test http authentication | |||
|
179 | 179 | > import base64 |
|
180 | 180 | > from mercurial.hgweb import common |
|
181 | 181 | > def perform_authentication(hgweb, req, op): |
|
182 | > auth = req.headers.get('Authorization') | |
|
182 | > auth = req.headers.get(b'Authorization') | |
|
183 | 183 | > if not auth: |
|
184 | > raise common.ErrorResponse(common.HTTP_UNAUTHORIZED, 'who', | |
|
185 | > [('WWW-Authenticate', 'Basic Realm="mercurial"')]) | |
|
184 | > raise common.ErrorResponse(common.HTTP_UNAUTHORIZED, b'who', | |
|
185 | > [(b'WWW-Authenticate', b'Basic Realm="mercurial"')]) | |
|
186 | 186 | > if base64.b64decode(auth.split()[1]).split(b':', 1) != [b'user', |
|
187 | 187 | > b'pass']: |
|
188 | > raise common.ErrorResponse(common.HTTP_FORBIDDEN, 'no') | |
|
188 | > raise common.ErrorResponse(common.HTTP_FORBIDDEN, b'no') | |
|
189 | 189 | > def extsetup(): |
|
190 | 190 | > common.permhooks.insert(0, perform_authentication) |
|
191 | 191 | > EOT |
General Comments 0
You need to be logged in to leave comments.
Login now