# CORS problem with PUT method

**URL:** <https://discourse.sst.dev/t/cors-problem-with-put-method/1359>\
**Category:** General\
**Created:** [October 14, 2019, 10:06pm UTC](https://discourse.sst.dev/t/cors-problem-with-put-method/1359 "2019-10-14T22:06:33Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Morters](https://avatars.discourse-cdn.com/v4/letter/m/f08c70/32.png) [@Morters](https://discourse.sst.dev/u/Morters)\
**Post date:** [October 14, 2019, 10:06pm UTC](https://discourse.sst.dev/t/cors-problem-with-put-method/1359/1 "2019-10-14T22:06:33Z")

</div>

Hi all,

I am trying to implement the ‘update’ note, but whenever I try to send an update using

```auto
dynamoDbLib.call("update", params);

```

I get an error saying that:

```auto
Access to XMLHttpRequest at ' **' from origin '**' has been blocked by CORS policy:
Method PUT is not allowed by Access-Control-Allow-Methods in preflight response.

```

(of course the ‘\*’ are the actual addresses that I removed)

I was doing everything that I read online, I made sure that my CORS rule is the same as what is shown on the tutorial, I made sure that the serverless.yml file is good, I also added this to my ‘response-lib.js’:

```auto
      headers: {
        "Access-Control-Allow-Origin": '*',
        "Access-Control-Allow-Credentials": true,
        "Access-Control-Allow-Methods": 'GET,POST,PUT,DELETE,OPTIONS',
        "Access-Control-Allow-Headers": 'Origin, X-Requested-With, Content-Type, Accept, Z-Key'
      },

```

But still no success… I added the logs to my bucket, but it seems like no log is being added, it seems my connection is being blocked from my end, and I have no idea what to do to fix this.

Thank you for your help!

---

<div class="post-metadata">

**Author:** ![jayair](https://yyz2.discourse-cdn.com/flex032/user_avatar/discourse.sst.dev/jayair/32/9_2.png) [@jayair](https://discourse.sst.dev/u/jayair)\
**Post date:** [October 26, 2019, 2:17am UTC](https://discourse.sst.dev/t/cors-problem-with-put-method/1359/2 "2019-10-26T02:17:46Z")

</div>

This line:

```auto
dynamoDbLib.call("update", params);

```

Is that in your React app or your Lambda function?
