Skip to content

Commit

Permalink
Header naming fix (#19)
Browse files Browse the repository at this point in the history
  • Loading branch information
justin-richert authored Jan 31, 2020
1 parent dc391db commit 893f2ac
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions luckycharms/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -224,9 +224,9 @@ def handle_empty(data):
def process_for_mimetype(data):
"""Serialize data per client mimetype request."""
if data:
if request.headers.get("Accepts", "application/json") == 'application/json':
if request.headers.get("Accept", "application/json") == 'application/json':
data = json.dumps(data)
elif request.headers.get("Accepts") == \
elif request.headers.get("Accept") == \
'application/octet-stream': # pragma: no branch
transformer = self.config['protobuffers']['dump_many'] if many \
else self.config['protobuffers']['dump']
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

setup(
name='luckycharms',
version='0.5.8',
version='0.5.9',
url='https://github.com/justin-richert/luckycharms',
download_url='https://github.com/justin-richert/luckycharms/archive/0.5.1.zip',
license='MIT',
Expand Down
6 changes: 3 additions & 3 deletions tests/test_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -659,7 +659,7 @@ def business_logic(*args, **kwargs):
data=proto.Test().dict_to_message({'a': 2, 'b': 'Two', 'c': False}).SerializeToString(),
headers={
'Content-Type': 'application/octet-stream',
'Accepts': 'application/octet-stream'
'Accept': 'application/octet-stream'
}):
result = business_logic()
assert isinstance(result, bytes)
Expand All @@ -677,7 +677,7 @@ def business_logic(*args, **kwargs):
data=proto_data[:-1],
headers={
'Content-Type': 'application/octet-stream',
'Accepts': 'application/octet-stream'
'Accept': 'application/octet-stream'
}):
with pytest.raises(flask_exceptions.BadRequest) as excinfo:
business_logic()
Expand Down Expand Up @@ -751,7 +751,7 @@ def business_logic(*args, **kwargs):
method='POST',
headers={
'Content-Type': 'application/octet-stream',
'Accepts': 'application/octet-stream'
'Accept': 'application/octet-stream'
}):
result = business_logic()
assert isinstance(result, bytes)
Expand Down

0 comments on commit 893f2ac

Please sign in to comment.