mirror of
https://github.com/jlengrand/bugsink.git
synced 2026-03-10 08:01:17 +00:00
Vendor parse_auth approach
This commit is contained in:
11
sentry/utils/auth.py
Normal file
11
sentry/utils/auth.py
Normal 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 {}
|
||||
Reference in New Issue
Block a user