Commit 4ddf6bed authored by Chris McDonough's avatar Chris McDonough

Bugfix for logging of username. Previous revision could raise errors which restarted Zope.

parent a786f8a4
......@@ -6,7 +6,7 @@
# All Rights Reserved.
#
RCS_ID = '$Id: http_server.py,v 1.26 2001/05/30 16:19:15 andreas Exp $'
RCS_ID = '$Id: http_server.py,v 1.27 2001/07/02 13:48:46 chrism Exp $'
# python modules
import os
......@@ -276,10 +276,13 @@ class http_request:
name='Anonymous'
if auth is not None:
if string.lower(auth[:6]) == 'basic ':
[name,password] = string.split(
base64.decodestring(
string.split(auth)[-1]), ':')
try: decoded=base64.decodestring(auth[6:])
except base64.binascii.Error: decoded=''
t = string.split(decoded, ':', 1)
if len(t) < 2:
name = 'Unknown (bad auth string)'
else:
name = t[0]
self.channel.server.logger.log (
self.channel.addr[0],
......
......@@ -6,7 +6,7 @@
# All Rights Reserved.
#
RCS_ID = '$Id: http_server.py,v 1.26 2001/05/30 16:19:15 andreas Exp $'
RCS_ID = '$Id: http_server.py,v 1.27 2001/07/02 13:48:46 chrism Exp $'
# python modules
import os
......@@ -276,10 +276,13 @@ class http_request:
name='Anonymous'
if auth is not None:
if string.lower(auth[:6]) == 'basic ':
[name,password] = string.split(
base64.decodestring(
string.split(auth)[-1]), ':')
try: decoded=base64.decodestring(auth[6:])
except base64.binascii.Error: decoded=''
t = string.split(decoded, ':', 1)
if len(t) < 2:
name = 'Unknown (bad auth string)'
else:
name = t[0]
self.channel.server.logger.log (
self.channel.addr[0],
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment