8000 Ensure custom headers override defaults (always lowercase) · core-api/python-client@154f36a · GitHub
[go: up one dir, main page]

Skip to content
This repository was archived by the owner on Mar 18, 2019. It is now read-only.

Commit 154f36a

Browse files
committed
Ensure custom headers override defaults (always lowercase)
1 parent 017499a commit 154f36a

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

coreapi/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
from coreapi.transport import BaseTransport, HTTPTransport
88

99

10-
__version__ = '1.11.1'
10+
__version__ = '1.11.2'
1111
__all__ = [
1212
'BaseCodec', 'CoreJSONCodec', 'HALCodec', 'HTMLCodec', 'PlainTextCodec', 'PythonCodec',
1313
'negotiate_encoder', 'negotiate_decoder',

coreapi/transport.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,8 @@ class HTTPTransport(BaseTransport):
3939
schemes = ['http', 'https']
4040

4141
def __init__(self, credentials=None, headers=None):
42+
if headers:
43+
headers = {key.lower(): value for key, value in headers.items()}
4244
self._credentials = itypes.Dict(credentials or {})
4345
self._headers = itypes.Dict(headers or {})
4446

0 commit comments

Comments
 (0)
0