AWS API Gateway: Use 302 redirect header and set cookie

I used the AWS API Gateway to redirect in response.

simple stream: aaa.com ====> API Gateway and Lambda == [302 redirect] ==> bbb.com

He worked well following the blog . However, I could not set a cookie on bbb.com.

I followed the blog and defined a different "Set-Cookie" header. The following is a snippet of Lambda code.

context.succeed({
    location : "http://192.168.173.193:3030",
    setCookie: "path=/;sessionID=1234;domain=null;"
});
+4
source share
1 answer

Have you updated the response options?

In this blog post, check out the responseParametersSwagger example section .

responseParameters:
          method.response.header.Location: "integration.response.body.location"

Set-Cookie. - :

responseParameters:
          method.response.header.Location: "integration.response.body.location"
          method.response.header.Set-Cookie: "integration.response.body.setCookie"
+2

All Articles