title: axios patch not working in chrome
body: <p>I'm trying to update some articles on a drupal site using React axios. GET and POST requests work, but I can't get PATCH to work. Sending the PATCH request through Postman works just fine. I get the following error using axios:</p>
  
  <blockquote>
    <p>Method PATCH is not allowed by Access-Control-Allow-Methods in
    preflight response.</p>
  </blockquote>
  
  <p>What am I doing wrong?</p>
  
  <p>Here's my code:</p>
  
  <pre><code>  editState(nid, value){
      let node = {
        "type":[{"target_id":"article","target_type":"node_type"}],
        "body":[{"value": value}]
      }
      let config = {
        headers: { 'Content-Type': 'application/json' }
      }
      axios.patch('http://localhost:8888/d8restapi/node/' + nid + '?_format=json',node,config)
      .then((success) =&gt; {
        console.log(success);
      }).catch((error) =&gt; {
        console.log(error);
      });
    }
  </code></pre>
  
  <p>Here are my OPTIONS request Headers:</p>
  
  <ul>
  <li>Request URL:<a href="http://localhost:8888/d8restapi/node/16?_format=json" rel="nofollow noreferrer">http://localhost:8888/d8restapi/node/16?_format=json</a></li>
  <li>Request Method:OPTIONS</li>
  <li>Status Code:200 OK</li>
  <li>Remote Address:[::1]:8888</li>
  <li>Referrer Policy:no-referrer-when-downgrade</li>
  <li>Response Headers</li>
  <li>view source</li>
  <li>Allow:GET, POST, DELETE, PATCH</li>
  <li>Cache-Control:must-revalidate, no-cache, private</li>
  <li>Connection:Keep-Alive</li>
  <li>Content-language:en</li>
  <li>Content-Length:0</li>
  <li>Content-Type:application/json</li>
  <li>Date:Fri, 03 Nov 2017 21:08:24 GMT</li>
  <li>Expires:Sun, 19 Nov 1978 05:00:00 GMT</li>
  <li>Keep-Alive:timeout=5, max=98</li>
  <li>Server:Apache/2.2.31 (Unix) mod_wsgi/3.5 Python/2.7.12 PHP/7.0.10</li>
  <li>mod_ssl/2.2.31 OpenSSL/1.0.2h DAV/2 mod_fastcgi/2.4.6 mod_perl/2.0.9</li>
  <li>Perl/v5.24.0</li>
  <li>X-Content-Type-Options:nosniff</li>
  <li>X-Content-Type-Options:nosniff</li>
  <li>X-Frame-Options:SAMEORIGIN</li>
  <li>X-Generator:Drupal 8 (<a href="https://www.drupal.org" rel="nofollow noreferrer">https://www.drupal.org</a>)</li>
  <li>X-Powered-By:PHP/7.0.10</li>
  <li>X-UA-Compatible:IE=edge</li>
  <li>Request Headers</li>
  <li>view source</li>
  <li>Accept:<em>/</em></li>
  <li>Accept-Encoding:gzip, deflate, br</li>
  <li>Accept-Language:en,en-US;q=0.8,sv;q=0.6,fi;q=0.4</li>
  <li>Access-Control-Request-Headers:content-type</li>
  <li>Access-Control-Request-Method:PATCH</li>
  <li>Connection:keep-alive</li>
  <li>Host:localhost:8888</li>
  <li>Origin:<a href="http://evil.com/" rel="nofollow noreferrer">http://evil.com/</a></li>
  <li>Referer:<a href="http://localhost:3000/" rel="nofollow noreferrer">http://localhost:3000/</a></li>
  <li>User-Agent:Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_6)</li>
  <li>AppleWebKit/537.36 (KHTML, like Gecko) Chrome/61.0.3163.100
  Safari/537.36</li>
  <li>Query String Parameters</li>
  <li>view source</li>
  <li>view URL encoded</li>
  <li>_format:json</li>
  </ul>
  
  <p>Edit: Tested with Firefox and it works, but it doesn't work in Chrome! Have emptied caches and restarted and done a hard reload to no avail.</p>
  
  <p>Edit 2: Problem solved. I installed another CORS plugin in Chrome. The following works in case anyone is facing the same problem with other CORS plugins:</p>
  
  <p><a href="https://chrome.google.com/webstore/detail/moesif-origin-cors-change/digfbfaphojjndkpccljibejjbppifbc" rel="nofollow noreferrer">https://chrome.google.com/webstore/detail/moesif-origin-cors-change/digfbfaphojjndkpccljibejjbppifbc</a></p>