#3991 - AWSLambda - set content-type to app/json (#4046)

This commit is contained in:
Bert Blommers 2021-06-30 11:02:38 +01:00 committed by GitHub
commit 8cc439444f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 0 deletions

View file

@ -209,6 +209,7 @@ class LambdaResponse(BaseResponse):
function_name, qualifier, self.body, self.headers, response_headers
)
if payload:
response_headers["content-type"] = "application/json"
if request.headers.get("X-Amz-Invocation-Type") == "Event":
status_code = 202
elif request.headers.get("X-Amz-Invocation-Type") == "DryRun":