diff --git a/ingest/tests.py b/ingest/tests.py index 7ce503c..052c7a7 100644 --- a/ingest/tests.py +++ b/ingest/tests.py @@ -1,3 +1,6 @@ from django.test import TestCase -# Create your tests here. + +class UtilsTestCase(TestCase): + def test_one(self): + self.asdf diff --git a/sentry/utils/auth.py b/sentry/utils/auth.py index 0464d7f..639a928 100644 --- a/sentry/utils/auth.py +++ b/sentry/utils/auth.py @@ -1,11 +1,21 @@ def _make_key_value(val): + # strip, and then split on '=' return val.strip().split("=", 1) 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") + try: + # the the RHS of the header (question: what's left of the space), split it on "," and put the x=y pairs into a + # dict as key-values return dict(map(_make_key_value, header.split(" ", 1)[1].split(","))) except Exception: return {}