diff --git a/pinotdb/db.py b/pinotdb/db.py index e1546bf..504eeab 100644 --- a/pinotdb/db.py +++ b/pinotdb/db.py @@ -330,7 +330,7 @@ def __init__( extra_headers = {} if extra_request_headers: for header in extra_request_headers.split(","): - k, v = header.split("=") + k, v = header.split("=", 1) extra_headers[k] = v self.session.headers.update(extra_headers) diff --git a/tests/unit/test_db.py b/tests/unit/test_db.py index c09e6fb..6af6209 100644 --- a/tests/unit/test_db.py +++ b/tests/unit/test_db.py @@ -331,10 +331,11 @@ def test_instantiates_with_auth(self): def test_instantiates_with_extra_headers(self): cursor = db.Cursor( host='localhost', session=httpx.Client(), - extra_request_headers='foo=bar,baz=yo') + extra_request_headers='foo=bar,baz=yo,Authorization=Bearer foo=') self.assertEqual(cursor.session.headers['foo'], 'bar') self.assertEqual(cursor.session.headers['baz'], 'yo') + self.assertEqual(cursor.session.headers['Authorization'], 'Bearer foo=') def test_checks_valid_exception_if_not_containing_error_code(self): cursor = db.Cursor(host='localhost', session=httpx.Client())