Skip to content

Commit 11482ba

Browse files
authored
Fix bug where equal sign could not be in value of header (#84)
1 parent 8b666c3 commit 11482ba

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

pinotdb/db.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -331,7 +331,7 @@ def __init__(
331331
extra_headers = {}
332332
if extra_request_headers:
333333
for header in extra_request_headers.split(","):
334-
k, v = header.split("=")
334+
k, v = header.split("=", 1)
335335
extra_headers[k] = v
336336

337337
self.session.headers.update(extra_headers)

tests/unit/test_db.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -331,10 +331,11 @@ def test_instantiates_with_auth(self):
331331
def test_instantiates_with_extra_headers(self):
332332
cursor = db.Cursor(
333333
host='localhost', session=httpx.Client(),
334-
extra_request_headers='foo=bar,baz=yo')
334+
extra_request_headers='foo=bar,baz=yo,Authorization=Bearer foo=')
335335

336336
self.assertEqual(cursor.session.headers['foo'], 'bar')
337337
self.assertEqual(cursor.session.headers['baz'], 'yo')
338+
self.assertEqual(cursor.session.headers['Authorization'], 'Bearer foo=')
338339

339340
def test_checks_valid_exception_if_not_containing_error_code(self):
340341
cursor = db.Cursor(host='localhost', session=httpx.Client())

0 commit comments

Comments
 (0)