Skip to content

Commit

Permalink
#85 use headers.extend instead of adding headers one by one
Browse files Browse the repository at this point in the history
  • Loading branch information
jmcs committed Nov 6, 2015
1 parent b6c9457 commit 53ac59f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 5 deletions.
3 changes: 1 addition & 2 deletions connexion/decorators/produces.py
Expand Up @@ -61,8 +61,7 @@ def process_headers(response, headers):
:rtype flask.Response
"""
if headers:
for header, value in headers.items():
response.headers[header] = value
response.headers.extend(headers)
return response

def __repr__(self):
Expand Down
4 changes: 1 addition & 3 deletions connexion/problem.py
Expand Up @@ -46,9 +46,7 @@ def problem(status, title, detail, type='about:blank', instance=None, headers=No
body = json.dumps(problem_response)
response = flask.current_app.response_class(body, mimetype='application/problem+json',
status=status) # type: flask.Response

if headers:
for key, value in headers.items():
response.headers[key] = value
response.headers.extend(headers)

return response

0 comments on commit 53ac59f

Please sign in to comment.