CORS error :Request header field Authorization is not allowed by Access-Control-Allow-Headers in preflight response : <p>I am trying to send the request from one localhost port to the another. I am using <strong>angularjs on the frontend and node on the backend</strong>.</p>

<p>Since it is <strong>CORS</strong> request, In node.js, i am using </p>

<pre><code>res.header('Access-Control-Allow-Origin', '*');
res.header('Access-Control-Allow-Methods', 'GET, POST, PUT, DELETE, PATCH');
res.header('Access-Control-Allow-Headers', 'Origin, X-Requested-With, Content-Type, Accept, Authorization');
</code></pre>

<p>and in the angular.js service file, I am using</p>

<pre><code>return {
    getValues: $resource(endpoint + '/admin/getvalues', null, {
        'get': {
             method: 'GET',
             headers:{'Authorization':'Bearer'+' '+ $localStorage.token}
             }
     }),
}
</code></pre>

<p>I am getting the following error</p>

<p><strong>Request header field Authorization is not allowed by Access-Control-Allow-Headers in preflight response.</strong></p>

<p>Please help!</p>
