Commit 92e5e611 authored by Kazuhiko Shiozaki's avatar Kazuhiko Shiozaki

only quote a path part in request string.

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@22631 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 7a37b870
...@@ -57,6 +57,12 @@ def log (self, bytes): ...@@ -57,6 +57,12 @@ def log (self, bytes):
else: else:
name = t[0] name = t[0]
# Originally, an unquoted request string was logged, but
# it only confuses log analysis programs! Note that Apache
# HTTP Server never unquote URIs in the access log.
t = self.request.split(' ')
quoted_request = '%s %s %s' % (t[0], quote(' '.join(t[1:-1])), t[-1])
self.channel.server.logger.log ( self.channel.server.logger.log (
# <patch> # <patch>
addr, addr,
...@@ -64,11 +70,8 @@ def log (self, bytes): ...@@ -64,11 +70,8 @@ def log (self, bytes):
'- %s [%s] "%s" %d %d "%s" "%s"\n' % ( '- %s [%s] "%s" %d %d "%s" "%s"\n' % (
name, name,
self.log_date_string (time.time()), self.log_date_string (time.time()),
# Originally, an unquoted request string was logged, but
# it only confuses log analysis programs! Note that Apache
# HTTP Server never unquote URIs in the access log.
# <patch> # <patch>
quote(self.request), quoted_request,
# </patch> # </patch>
self.reply_code, self.reply_code,
bytes, bytes,
......
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