Actually connect events to the correct project when the header is provided

This commit is contained in:
Klaas van Schelven
2023-11-09 23:49:52 +01:00
parent 791a14adc9
commit 66b30bb792
4 changed files with 70 additions and 15 deletions

View File

@@ -1,12 +1,7 @@
def parse_auth_header(header):
# KvS: isn't this always either bytes or strings? I'd like to learn more (first quickly, and then formalizing for
# actual uses)
# https://github.com/getsentry/sentry/pull/12108 is the non-explanation
if isinstance(header, bytes):
print("it's bytes, probably always so")
header = header.decode("latin1")
else:
print("not bytes, already a string")
# Sentry has code in place here to parse bytes (from latin1). Based on how Django works, I'd like to think that's
# not needed. https://github.com/getsentry/sentry/pull/12108 is the non-explanation
# if isinstance(header, bytes): header = header.decode("latin1")
try:
_, rhs = header.split(" ", 1)