# \#cors

**URL:** https://forum.serverless.com/tag/cors/17.md

[Latest](https://forum.serverless.com/latest.md) · [Categories](https://forum.serverless.com/categories.md) · [Tags](https://forum.serverless.com/tags.md)

---

## [CORS Error in Safari: No Access-Control-Allow-Origin Header on Response](https://forum.serverless.com/t/cors-error-in-safari-no-access-control-allow-origin-header-on-response/21141)

<div class="topic-metadata">

**Author:** [@daay22](https://forum.serverless.com/u/daay22)\
**Replies:** 1\
**Last updated:** [February 26, 2026, 9:40pm UTC](https://forum.serverless.com/t/cors-error-in-safari-no-access-control-allow-origin-header-on-response/21141 "2026-02-26T21:40:13Z")

</div>

I am facing an issue where my backend API is returning a CORS error in Safari but works fine in Chrome and Postman. The specific error in Safari is: Access to XMLHttpRequest at ‘https://backendServer/users/login?email=e…

---

## [Access to fetch at 'apigw.XXXX' from origin 'http://localhost:3002' has been blocked by CORS policy: Response to preflight request doesn't pass access control check: It does not have HTTP ok status](https://forum.serverless.com/t/access-to-fetch-at-apigw-xxxx-from-origin-http-localhost-3002-has-been-blocked-by-cors-policy-response-to-preflight-request-doesnt-pass-access-control-check-it-does-not-have-http-ok-status/17728)

<div class="topic-metadata">

**Author:** [@Kahina](https://forum.serverless.com/u/Kahina)\
**Replies:** 0\
**Last updated:** [October 12, 2022, 9:20am UTC](https://forum.serverless.com/t/access-to-fetch-at-apigw-xxxx-from-origin-http-localhost-3002-has-been-blocked-by-cors-policy-response-to-preflight-request-doesnt-pass-access-control-check-it-does-not-have-http-ok-status/17728 "2022-10-12T09:20:30Z")

</div>

Hello, I’m trying to connect to my Rest API (a lambda function + serverless), but I’m getting this cors error in my front web app side: Access to fetch at 'https://apigw.xxx from origin ‘http://localhost:3002’ has bee…

---

## [The CloudFormation template is invalid: Template format error: Unresolved resource dependencies \[ApiGatewayRestApi\] in the Resources block of the template](https://forum.serverless.com/t/the-cloudformation-template-is-invalid-template-format-error-unresolved-resource-dependencies-apigatewayrestapi-in-the-resources-block-of-the-template/17722)

<div class="topic-metadata">

**Author:** [@Kahina](https://forum.serverless.com/u/Kahina)\
**Replies:** 0\
**Last updated:** [October 10, 2022, 8:13pm UTC](https://forum.serverless.com/t/the-cloudformation-template-is-invalid-template-format-error-unresolved-resource-dependencies-apigatewayrestapi-in-the-resources-block-of-the-template/17722 "2022-10-10T20:13:20Z")

</div>

Hello, I had a cors problem when trying to call a lambda function, when trying to fix the problem, I added an APIGateway as a resource like mentioned here: Your CORS and API Gateway survival guide When I’ve deployed th…

---

## [HTTP requests working post but not failing on CORS for get](https://forum.serverless.com/t/http-requests-working-post-but-not-failing-on-cors-for-get/17550)

<div class="topic-metadata">

**Author:** [@andyrewwer](https://forum.serverless.com/u/andyrewwer)\
**Replies:** 1\
**Last updated:** [August 24, 2022, 5:51pm UTC](https://forum.serverless.com/t/http-requests-working-post-but-not-failing-on-cors-for-get/17550 "2022-08-24T17:51:56Z")

</div>

Hello, I am creating an API and deploying to lambda using Serverless. Has worked great before. Now my API is allowed the POST but all GET requests are failing with CORS error message: Access to XMLHttpRequest at 'https…

---

## [Application Load Balancer CORS](https://forum.serverless.com/t/application-load-balancer-cors/10550)

<div class="topic-metadata">

**Author:** [@Khazuar](https://forum.serverless.com/u/Khazuar)\
**Replies:** 6\
**Last updated:** [August 12, 2022, 6:03pm UTC](https://forum.serverless.com/t/application-load-balancer-cors/10550 "2022-08-12T18:03:46Z")

</div>

Hi, we’re using an AWS ALB (application load balancer) to orchestrate access to some preexisting services of ours which are running in AWS ESC containers. I now wanted to add a serverless node.js application for a few ne…

---

## [Multiple CORS origins](https://forum.serverless.com/t/multiple-cors-origins/14918)

<div class="topic-metadata">

**Author:** [@nessatse](https://forum.serverless.com/u/nessatse)\
**Replies:** 3\
**Last updated:** [January 19, 2022, 5:51pm UTC](https://forum.serverless.com/t/multiple-cors-origins/14918 "2022-01-19T17:51:29Z")

</div>

According to the documentation at https://www.serverless.com/framework/docs/providers/aws/events/apigateway/#enabling-cors I should be able to add multiple origins to the cors definition: cors: or…

---

## [Request intermittently not including 'access-control-allow-origin' header in response](https://forum.serverless.com/t/request-intermittently-not-including-access-control-allow-origin-header-in-response/17086)

<div class="topic-metadata">

**Author:** [@jakeowen](https://forum.serverless.com/u/jakeowen)\
**Replies:** 1\
**Last updated:** [April 28, 2022, 12:18pm UTC](https://forum.serverless.com/t/request-intermittently-not-including-access-control-allow-origin-header-in-response/17086 "2022-04-28T12:18:03Z")

</div>

I am running a HTTP lambda through serverless - I have set up cors using serverless. For the majority of users - there’s no issue. For a very small percentage of users - the request following the OPTIONS call is not re…

---

## [CORS question on using a REACT app with Serverless Framework](https://forum.serverless.com/t/cors-question-on-using-a-react-app-with-serverless-framework/16990)

<div class="topic-metadata">

**Author:** [@CelesteBlanca10](https://forum.serverless.com/u/CelesteBlanca10)\
**Replies:** 0\
**Last updated:** [April 6, 2022, 6:25pm UTC](https://forum.serverless.com/t/cors-question-on-using-a-react-app-with-serverless-framework/16990 "2022-04-06T18:25:34Z")

</div>

I’ve seen many posts on this topic, but all of them deal with the CORS error message about missing headers and such. I’m facing a different issue (I think…) - I’m getting a valid 200 response that looks like this: Res…

---

## [API Gateway HTTP API & CORS](https://forum.serverless.com/t/api-gateway-http-api-cors/12416)

<div class="topic-metadata">

**Author:** [@muhwu](https://forum.serverless.com/u/muhwu)\
**Replies:** 5\
**Last updated:** [March 1, 2022, 9:46am UTC](https://forum.serverless.com/t/api-gateway-http-api-cors/12416 "2022-03-01T09:46:43Z")

</div>

New in the forums here and relatively new to Serverless framework here so bear with me. I have a simple end-point that I deployed using the httpApi. I want to set up CORS for it and according to the reference here, it sh…

---

## [CORS with credentials throwing "Access-Control-Allow-Origin' header in the response must not be the wildcard \*"](https://forum.serverless.com/t/cors-with-credentials-throwing-access-control-allow-origin-header-in-the-response-must-not-be-the-wildcard/7482)

<div class="topic-metadata">

**Author:** [@Borduhh](https://forum.serverless.com/u/Borduhh)\
**Replies:** 4\
**Last updated:** [June 19, 2021, 1:22am UTC](https://forum.serverless.com/t/cors-with-credentials-throwing-access-control-allow-origin-header-in-the-response-must-not-be-the-wildcard/7482 "2021-06-19T01:22:55Z")

</div>

I am working with a Serverless deployment that proxies everything to Express for handling. I am trying to save a JWT in a secure cookie for API access. When I add credentials though, I get the following error: Access to…

---

## [CORS not working](https://forum.serverless.com/t/cors-not-working/11838)

<div class="topic-metadata">

**Author:** [@codemicky](https://forum.serverless.com/u/codemicky)\
**Replies:** 3\
**Last updated:** [September 30, 2020, 3:21am UTC](https://forum.serverless.com/t/cors-not-working/11838 "2020-09-30T03:21:02Z")

</div>

serverless.yml card: handler: src/get-card.handler events: - http: path: card method: post cors: origin: "\*" headers: - Content-Type - X-Requested-With …

---

## [Cors config doesn't seem to do anything](https://forum.serverless.com/t/cors-config-doesnt-seem-to-do-anything/12365)

<div class="topic-metadata">

**Author:** [@Troncoso](https://forum.serverless.com/u/Troncoso)\
**Replies:** 1\
**Last updated:** [August 25, 2020, 12:37pm UTC](https://forum.serverless.com/t/cors-config-doesnt-seem-to-do-anything/12365 "2020-08-25T12:37:33Z")

</div>

I’m trying to get cors properly setup in API Gateway via my serverless config. As far as I can tell, though, the configuration isn’t really doing anything. My function is set up like this: plugins: - serverless-doma…

---

## [Lambda Function CORS error (using AWS Comprehend)](https://forum.serverless.com/t/lambda-function-cors-error-using-aws-comprehend/12050)

<div class="topic-metadata">

**Author:** [@mcoulibaly11](https://forum.serverless.com/u/mcoulibaly11)\
**Replies:** 0\
**Last updated:** [July 17, 2020, 4:17pm UTC](https://forum.serverless.com/t/lambda-function-cors-error-using-aws-comprehend/12050 "2020-07-17T16:17:30Z")

</div>

I am using serverless to invoke a lambda function in the handler.js function, but every time I try to execute the function with my click listener I get a cors error in the console, but I have cors set to true in my .yml …

---

## [How to set cors origin to request origin in preflight request](https://forum.serverless.com/t/how-to-set-cors-origin-to-request-origin-in-preflight-request/9517)

<div class="topic-metadata">

**Author:** [@Sceat](https://forum.serverless.com/u/Sceat)\
**Replies:** 0\
**Last updated:** [October 3, 2019, 2:38pm UTC](https://forum.serverless.com/t/how-to-set-cors-origin-to-request-origin-in-preflight-request/9517 "2019-10-03T14:38:55Z")

</div>

i basically just want to use this response template to accept credentials from any origin #set($origin = $input.params("Origin")) #if($origin == "") #set($origin = $input.params("origin")) #end #set($context.responseOve…

---

## [CORS failure in preflight requests, despite setting cors:true in serverless.yml](https://forum.serverless.com/t/cors-failure-in-preflight-requests-despite-setting-cors-true-in-serverless-yml/5406)

<div class="topic-metadata">

**Author:** [@justingrant](https://forum.serverless.com/u/justingrant)\
**Replies:** 2\
**Last updated:** [January 15, 2019, 11:52pm UTC](https://forum.serverless.com/t/cors-failure-in-preflight-requests-despite-setting-cors-true-in-serverless-yml/5406 "2019-01-15T23:52:30Z")

</div>

My preflight requests are failing with 403 errors, even the GET requests. I’m trying to get the notes example working in Serverless Stack 3.1 PDF. What are some suggestions for how to troubleshoot this? Here’s my server…

---

## [Are you struggling with CORS on Lambda with the AWS API Gateway?](https://forum.serverless.com/t/are-you-struggling-with-cors-on-lambda-with-the-aws-api-gateway/5151)

<div class="topic-metadata">

**Author:** [@rupakg](https://forum.serverless.com/u/rupakg)\
**Replies:** 0\
**Last updated:** [July 18, 2018, 9:58pm UTC](https://forum.serverless.com/t/are-you-struggling-with-cors-on-lambda-with-the-aws-api-gateway/5151 "2018-07-18T21:58:28Z")

</div>

Summary Get the basics on Cross-Origin Resource Sharing (CORS) and how to avoid problems with your Serverless web APIs on Lambda. Here is an awesome in-depth article written by Alex Debrie. Related links API Gatewa…
