- Neueste
- Die meisten Stimmen
- Die meisten Kommentare
Hi,
While using /{proxy+}
greedy path with Method as ANY
, API gateway will forward all the requests including OPTIONS method request to the attached intergration. Now, if this route has authentication enabled, OPTIONS method will fail since that is added by browser, it may not pass correct authentication credentials. Hence to avoid such failures, it is recommended to create a dedicated method OPTIONS
along with ANY
method. This new method will handle all CORS pre-flight requests and you can disable Authentication on this method.
Now, for HTTP API, since there is no MOCK integration, you might required to integrate the same with Lambda/any other integration so that it can return the correct CORS headers.
Am I expected to have a "dummy" lambda integration for this CORS work-around route?
yes, it is recommended to have lambda integration so that in future, if you wish to update your CORS headers, you can do so by updating lambda code
I guess this explains your question.
Relevanter Inhalt
- AWS OFFICIALAktualisiert vor 2 Jahren
- AWS OFFICIALAktualisiert vor 2 Jahren
- AWS OFFICIALAktualisiert vor einem Jahr
- AWS OFFICIALAktualisiert vor einem Jahr