title: CORS problem - Access to fetch at *** from origin *** has been blocked by CORS policy: No 'Access-Control-Allow-Origin' - PUT request to Firebase
body: <p>I have CORS problem, I am sending an put request for updating data - posts into Firebase with React:</p>
  <pre><code>const submitHandler = e =&gt; {
          e.preventDefault();
          const err = validate();
          if(err === false) {
              setFormData(formData)
              const requestOptions = {
                  method: 'PUT',
                  headers: {'Content-Type': 'application/json'},
                  body: JSON.stringify({
                      title: title,
                      url: url,
                      author: author,
                      description: description})
              };
              fetch(`https://blog-d8b04-default-rtdb.europe-west1.firebasedatabase.app/posts/${postName}`, requestOptions)
                  .then(response =&gt; {response.json(); console.log(response)})
                  .then(data =&gt; console.log(data));
              setFormData(initialState);
          }
      }
  </code></pre>
  <p>I have this notification error in console</p>
  <pre><code>Access to fetch at 'https://blog-d8b04-default-rtdb.europe-west1.firebasedatabase.app/posts/-MX1-Df4t59Y3DnyWUzB' from origin 'http://localhost:3000' has been blocked by CORS policy: Response to preflight request doesn't pass access control check: It does not have HTTP ok status.
  EditPost.js:58 PUT https://blog-d8b04-default-rtdb.europe-west1.firebasedatabase.app/posts/-MX1-Df4t59Y3DnyWUzB net::ERR_FAILED
  
  </code></pre>
  <p>With post request - to add new posts everything is working fine.
  Has someone solution for this problem?</p>