mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-08-02 03:46:10 -04:00
redact better
This commit is contained in:
parent
63755fa4c2
commit
7c33ab76da
1 changed files with 2 additions and 2 deletions
|
@ -38,12 +38,12 @@ def cancelled_to_request_timed_out_error(value, timeout):
|
||||||
return value
|
return value
|
||||||
|
|
||||||
|
|
||||||
ACCESS_TOKEN_RE = re.compile(br'(\?.*access(_|%5[Ff])token=)[^&]*(.*)$')
|
ACCESS_TOKEN_RE = re.compile(r'(\?.*access(_|%5[Ff])token=)[^&]*(.*)$')
|
||||||
|
|
||||||
|
|
||||||
def redact_uri(uri):
|
def redact_uri(uri):
|
||||||
"""Strips access tokens from the uri replaces with <redacted>"""
|
"""Strips access tokens from the uri replaces with <redacted>"""
|
||||||
return ACCESS_TOKEN_RE.sub(
|
return ACCESS_TOKEN_RE.sub(
|
||||||
br'\1<redacted>\3',
|
r'\1<redacted>\3',
|
||||||
uri
|
uri
|
||||||
)
|
)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue