# Request intermittently not including 'access-control-allow-origin' header in response

**URL:** <https://forum.serverless.com/t/request-intermittently-not-including-access-control-allow-origin-header-in-response/17086>\
**Category:** Serverless Framework\
**Tags:** aws, lambda, cors, api-gateway\
**Created:** [April 26, 2022, 11:04am UTC](https://forum.serverless.com/t/request-intermittently-not-including-access-control-allow-origin-header-in-response/17086 "2022-04-26T11:04:09Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![jakeowen](https://avatars.discourse-cdn.com/v4/letter/j/d9b06d/32.png) [@jakeowen](https://forum.serverless.com/u/jakeowen)\
**Post date:** [April 26, 2022, 11:04am UTC](https://forum.serverless.com/t/request-intermittently-not-including-access-control-allow-origin-header-in-response/17086/1 "2022-04-26T11:04:09Z")

</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 returning `access-control-allow-origin`.

It has a successful preflight, that returns `access-control-allow-origin` - but the POST request following doesn’t return `access-control-allow-origin` - causing a CORS error.

For the users it doesn’t work for - no matter if they change computer or network - it still happens - and it’s always the same users.

What can affect returning an `access-control-allow-origin`? I’ve looked through the HAR files and for the 98% of users it works for and the 2% it doesn’t - the requests and responses look the same apart from `access-control-allow-origin` missing in the POST request after OPTIONS

Happy to send over the HAR files if that would help

---

<div class="post-metadata">

**Author:** ![jakeowen](https://avatars.discourse-cdn.com/v4/letter/j/d9b06d/32.png) [@jakeowen](https://forum.serverless.com/u/jakeowen)\
**Post date:** [April 28, 2022, 12:18pm UTC](https://forum.serverless.com/t/request-intermittently-not-including-access-control-allow-origin-header-in-response/17086/2 "2022-04-28T12:18:03Z")

</div>

> <https://stackoverflow.com/questions/72043043/serverless-access-control-allow-origin-on-options-response-but-not-post-re>
