Vendor parse_auth approach

This commit is contained in:
Klaas van Schelven
2023-11-09 20:53:01 +01:00
parent 51bfb2879d
commit 3a8491fdc6
2 changed files with 37 additions and 1 deletions

11
sentry/utils/auth.py Normal file
View File

@@ -0,0 +1,11 @@
def _make_key_value(val):
return val.strip().split("=", 1)
def parse_auth_header(header):
if isinstance(header, bytes):
header = header.decode("latin1")
try:
return dict(map(_make_key_value, header.split(" ", 1)[1].split(",")))
except Exception:
return {}