繁体   English   中英

AWS API Gateway:使用302重定向和set-cookie标头

[英]AWS API Gateway : Use 302 redirect and set-cookie header

我使用AWS API Gateway进行重定向以作为响应。

简单流程 :aaa.com ====> API Gateway&Lambda == [302 redirect] ==> bbb.com

关注博客时效果很好。 但是,我无法在bbb.com上设置cookie。

我跟着博客,定义了另一个“Set-Cookie”标题。 我的Lambda代码片段如下所示。

context.succeed({
    location : "http://192.168.173.193:3030",
    setCookie: "path=/;sessionID=1234;domain=null;"
});

您是否更新了响应参数?

在该博客文章中,请注意Swagger示例的responseParameters部分。

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"

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM