我有以下配置
in
问题是,一旦我添加了端点functions:
auth:
handler: functions/auth.handler
cors: true
one:
handler: functions/one.handler
events:
- http:
path: one
method: post
authorizer: auth
cors: true
two:
handler: functions/two.handler
events:
- http:
path: two
method: post
authorizer: auth
cors: true
resources:
Resources:
GatewayResponse:
Type: 'AWS::ApiGateway::GatewayResponse'
Properties:
ResponseParameters:
gatewayresponse.header.Access-Control-Allow-Origin: "'*'"
gatewayresponse.header.Access-Control-Allow-Headers: "'*'"
ResponseType: EXPIRED_TOKEN
RestApiId:
Ref: 'ApiGatewayRestApi'
StatusCode: '401'
AuthFailureGatewayResponse:
Type: 'AWS::ApiGateway::GatewayResponse'
Properties:
ResponseParameters:
gatewayresponse.header.Access-Control-Allow-Origin: "'*'"
gatewayresponse.header.Access-Control-Allow-Headers: "'*'"
ResponseType: UNAUTHORIZED
RestApiId:
Ref: 'ApiGatewayRestApi'
StatusCode: '401'
,cors便停止工作,我需要将其删除并只留下一个端点,我尝试使用它,更改了方法,但问题仍然存在
所有lambda返回如下:
two
因此设置了标头。再次,这一问题出现时的第二端点被添加,如果我只留下一个它独立工作。
有什么想法吗?