serverless/serverless

API gateway: Ensure CORS headers for non 200 status codes

Aperta

#3896 aperta il 5 lug 2017

 (36 commenti) (35 reazioni) (0 assegnatari)JavaScript (5734 fork)batch import
cat/aws-event-api-gatewayenhancementhelp wantedneeds feedback

Metriche repository

Star
 (46.915 stelle)
Metriche merge PR
 (Merge medio 1g 15h) (34 PR mergiate in 30 g)

Descrizione

This is a Question/Feature Proposal

Description

  • I am not sure if this is possible with serverless, but I couldn't find anything in the docs. When using Cognito authorises with serverless, when identity token becomes invalid, the response from the api gateway is 401(unauthorised), but there is no way to set cors headers on that response. While using AWS Console this can be done via "Gateway Responses" (see image below) tab. console way to do it

Additional Data

  • Serverless Framework Version you're using: 1.16.1
  • Operating System: ubuntu 16.04

Guida contributor