Mercurial > p > roundup > code
comparison roundup/cgi/client.py @ 2937:46fdfcf42806
HTTP_AUTHORIZATION may be not present in environment
| author | Alexander Smishlajev <a1s@users.sourceforge.net> |
|---|---|
| date | Sat, 20 Nov 2004 17:46:24 +0000 |
| parents | 81c99c857b57 |
| children | 463902a0fbbb |
comparison
equal
deleted
inserted
replaced
| 2936:b5ad71ecf72b | 2937:46fdfcf42806 |
|---|---|
| 1 # $Id: client.py,v 1.202 2004-11-18 16:21:07 a1s Exp $ | 1 # $Id: client.py,v 1.203 2004-11-20 17:46:24 a1s Exp $ |
| 2 | 2 |
| 3 """WWW request handler (also used in the stand-alone server). | 3 """WWW request handler (also used in the stand-alone server). |
| 4 """ | 4 """ |
| 5 __docformat__ = 'restructuredtext' | 5 __docformat__ = 'restructuredtext' |
| 6 | 6 |
| 377 user = self.env['REMOTE_USER'] | 377 user = self.env['REMOTE_USER'] |
| 378 else: | 378 else: |
| 379 user = 'anonymous' | 379 user = 'anonymous' |
| 380 | 380 |
| 381 # try handling Basic Auth ourselves | 381 # try handling Basic Auth ourselves |
| 382 if (user == 'anonymous') and self.env['HTTP_AUTHORIZATION']: | 382 if (user == 'anonymous') and self.env.get('HTTP_AUTHORIZATION', ''): |
| 383 scheme, challenge = self.env['HTTP_AUTHORIZATION'].split(' ', 1) | 383 scheme, challenge = self.env['HTTP_AUTHORIZATION'].split(' ', 1) |
| 384 if scheme.lower() == 'basic': | 384 if scheme.lower() == 'basic': |
| 385 try: | 385 try: |
| 386 decoded = base64.decodestring(challenge) | 386 decoded = base64.decodestring(challenge) |
| 387 except TypeError: | 387 except TypeError: |
