parent
163ae322e8
commit
8cc439444f
@ -209,6 +209,7 @@ class LambdaResponse(BaseResponse):
|
|||||||
function_name, qualifier, self.body, self.headers, response_headers
|
function_name, qualifier, self.body, self.headers, response_headers
|
||||||
)
|
)
|
||||||
if payload:
|
if payload:
|
||||||
|
response_headers["content-type"] = "application/json"
|
||||||
if request.headers.get("X-Amz-Invocation-Type") == "Event":
|
if request.headers.get("X-Amz-Invocation-Type") == "Event":
|
||||||
status_code = 202
|
status_code = 202
|
||||||
elif request.headers.get("X-Amz-Invocation-Type") == "DryRun":
|
elif request.headers.get("X-Amz-Invocation-Type") == "DryRun":
|
||||||
|
@ -157,6 +157,9 @@ def test_invoke_requestresponse_function(invocation_type):
|
|||||||
assert False, success_result["Payload"].read().decode("utf-8")
|
assert False, success_result["Payload"].read().decode("utf-8")
|
||||||
|
|
||||||
success_result["StatusCode"].should.equal(200)
|
success_result["StatusCode"].should.equal(200)
|
||||||
|
success_result["ResponseMetadata"]["HTTPHeaders"]["content-type"].should.equal(
|
||||||
|
"application/json"
|
||||||
|
)
|
||||||
logs = base64.b64decode(success_result["LogResult"]).decode("utf-8")
|
logs = base64.b64decode(success_result["LogResult"]).decode("utf-8")
|
||||||
|
|
||||||
logs.should.contain("START RequestId:")
|
logs.should.contain("START RequestId:")
|
||||||
@ -172,6 +175,9 @@ def test_invoke_requestresponse_function(invocation_type):
|
|||||||
)
|
)
|
||||||
|
|
||||||
success_result["StatusCode"].should.equal(200)
|
success_result["StatusCode"].should.equal(200)
|
||||||
|
success_result["ResponseMetadata"]["HTTPHeaders"]["content-type"].should.equal(
|
||||||
|
"application/json"
|
||||||
|
)
|
||||||
assert "LogResult" not in success_result
|
assert "LogResult" not in success_result
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user