Properly quote reason header so non-ASCII works in audit log reasons.
This commit is contained in:
parent
15edfc2b26
commit
851d4ce22a
@ -32,6 +32,7 @@ import logging
|
|||||||
import weakref
|
import weakref
|
||||||
import datetime
|
import datetime
|
||||||
from email.utils import parsedate_to_datetime
|
from email.utils import parsedate_to_datetime
|
||||||
|
from urllib.parse import quote as _uriquote
|
||||||
|
|
||||||
log = logging.getLogger(__name__)
|
log = logging.getLogger(__name__)
|
||||||
|
|
||||||
@ -130,7 +131,7 @@ class HTTPClient:
|
|||||||
pass
|
pass
|
||||||
else:
|
else:
|
||||||
if reason:
|
if reason:
|
||||||
headers['X-Audit-Log-Reason'] = reason
|
headers['X-Audit-Log-Reason'] = _uriquote(reason, safe='/ ')
|
||||||
|
|
||||||
kwargs['headers'] = headers
|
kwargs['headers'] = headers
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user