【发布时间】:2022-10-18 04:04:19
【问题描述】:
我正在尝试从我的 API 发送自定义响应标头,我尝试使用 events.response.statusCodes 但它不起作用,看起来它仅针对http 而不是针对httpApi 事件实现。
functions:
myfunction:
name: test
handler: src/index.handler
events:
- httpApi:
path: /graphql
method: post
response:
statusCodes:
200:
headers:
Strict-Transport-Security: "'max-age=31536000'"
500:
headers:
Strict-Transport-Security: "'max-age=31536000'"
【问题讨论】:
标签: amazon-web-services api aws-api-gateway serverless serverless-framework