mirror of
https://mau.dev/maunium/synapse.git
synced 2024-12-16 22:53:52 +01:00
Strip access_token
from outgoing requests using existing regex
This commit is contained in:
parent
a9e97dcd65
commit
09503126df
1 changed files with 6 additions and 1 deletions
|
@ -20,6 +20,7 @@ from synapse.api.errors import (
|
||||||
CodeMessageException, MatrixCodeMessageException, SynapseError, Codes,
|
CodeMessageException, MatrixCodeMessageException, SynapseError, Codes,
|
||||||
)
|
)
|
||||||
from synapse.http import cancelled_to_request_timed_out_error
|
from synapse.http import cancelled_to_request_timed_out_error
|
||||||
|
from synapse.http.site import ACCESS_TOKEN_RE
|
||||||
from synapse.util.async import add_timeout_to_deferred
|
from synapse.util.async import add_timeout_to_deferred
|
||||||
from synapse.util.caches import CACHE_SIZE_FACTOR
|
from synapse.util.caches import CACHE_SIZE_FACTOR
|
||||||
from synapse.util.logcontext import make_deferred_yieldable
|
from synapse.util.logcontext import make_deferred_yieldable
|
||||||
|
@ -90,7 +91,11 @@ class SimpleHttpClient(object):
|
||||||
# counters to it
|
# counters to it
|
||||||
outgoing_requests_counter.labels(method).inc()
|
outgoing_requests_counter.labels(method).inc()
|
||||||
|
|
||||||
logger.info("Sending request %s %s", method, uri)
|
# 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
|
||||||
|
))
|
||||||
|
|
||||||
try:
|
try:
|
||||||
request_deferred = self.agent.request(
|
request_deferred = self.agent.request(
|
||||||
|
|
Loading…
Reference in a new issue