summary refs log tree commit diff
path: root/synapse/http/client.py
diff options
context:
space:
mode:
authorMichael Telatynski <7t3chguy@gmail.com>2018-06-05 18:31:40 +0100
committerMichael Telatynski <7t3chguy@gmail.com>2018-06-05 18:31:40 +0100
commite6cbf47773472e6e3dd1884bb0376d3d66a37433 (patch)
treec858afd3cf93aaf0f25898c0eaec9a396e619c2e /synapse/http/client.py
parentStrip `access_token` from outgoing requests using existing regex (diff)
downloadsynapse-e6cbf47773472e6e3dd1884bb0376d3d66a37433.tar.xz
factor out uri redaction into a method on http
Diffstat (limited to 'synapse/http/client.py')
-rw-r--r--synapse/http/client.py8
1 files changed, 2 insertions, 6 deletions
diff --git a/synapse/http/client.py b/synapse/http/client.py
index 89db33453b..5820d3e96f 100644
--- a/synapse/http/client.py
+++ b/synapse/http/client.py
@@ -19,8 +19,7 @@ from OpenSSL.SSL import VERIFY_NONE
 from synapse.api.errors import (
     CodeMessageException, MatrixCodeMessageException, SynapseError, Codes,
 )
-from synapse.http import cancelled_to_request_timed_out_error
-from synapse.http.site import ACCESS_TOKEN_RE
+from synapse.http import cancelled_to_request_timed_out_error, redact_uri
 from synapse.util.async import add_timeout_to_deferred
 from synapse.util.caches import CACHE_SIZE_FACTOR
 from synapse.util.logcontext import make_deferred_yieldable
@@ -92,10 +91,7 @@ class SimpleHttpClient(object):
         outgoing_requests_counter.labels(method).inc()
 
         # log request but strip `access_token` (AS requests for example include this)
-        logger.info("Sending request %s %s", method, ACCESS_TOKEN_RE.sub(
-            r'\1<redacted>\3',
-            uri
-        ))
+        logger.info("Sending request %s %s", method, redact_uri(uri))
 
         try:
             request_deferred = self.agent.request(