Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions samcli/local/apigw/service.py
Original file line number Diff line number Diff line change
Expand Up @@ -298,8 +298,11 @@ def _parse_lambda_output(lambda_output, binary_types, flask_request):

# If the customer doesn't define Content-Type default to application/json
if "Content-Type" not in headers:
LOG.info("No Content-Type given. Defaulting to 'application/json'.")
headers["Content-Type"] = "application/json"
if "content-type" in headers:
headers["Content-Type"] = headers["content-type"]
else:
LOG.info("No Content-Type given. Defaulting to 'application/json'.")
headers["Content-Type"] = "application/json"

if Service._should_base64_decode_body(binary_types, flask_request, headers, is_base_64_encoded):
body = base64.b64decode(body)
Expand Down