summary refs log tree commit diff
path: root/synapse/http/server.py
diff options
context:
space:
mode:
authorErik Johnston <erik@matrix.org>2015-06-15 16:36:49 +0100
committerErik Johnston <erik@matrix.org>2015-06-15 16:37:04 +0100
commitb5209c57441d9e7bace28a03774d2605a6572514 (patch)
treec7117faa2ec723c0713b4f9caf7f0ef87bdf241c /synapse/http/server.py
parentMerge branch 'erikj/listeners_config' into erikj/sanitize_logging (diff)
downloadsynapse-b5209c57441d9e7bace28a03774d2605a6572514.tar.xz
Create SynapseRequest that overrides __repr__ to not print access_token
Diffstat (limited to '')
-rw-r--r--synapse/http/server.py14
1 files changed, 3 insertions, 11 deletions
diff --git a/synapse/http/server.py b/synapse/http/server.py
index e6e8a59f6c..7f8b9dbb29 100644
--- a/synapse/http/server.py
+++ b/synapse/http/server.py
@@ -32,7 +32,6 @@ from twisted.web.util import redirectTo
 
 import collections
 import logging
-import re
 import urllib
 
 logger = logging.getLogger(__name__)
@@ -83,18 +82,11 @@ def request_handler(request_handler):
             code = None
             start = self.clock.time_msec()
             try:
-                request_uri = request.uri
-
-                # Don't log access_tokens
-                request_uri = re.sub(
-                    r'(\?.*access_token=)[^&]*(.*)$',
-                    r'\1<redacted>\2',
-                    request_uri
-                )
-
                 logger.info(
                     "%s - Received request: %s %s",
-                    request.getClientIP(), request.method, request_uri
+                    request.getClientIP(),
+                    request.method,
+                    request.get_redacted_uri()
                 )
                 d = request_handler(self, request)
                 with PreserveLoggingContext():