title: CORS works in chrome but not firefox, angularjs
body: <p>I'm trying to use angularJS with a Jetty backend.</p>
  
  <p>Preflight CORS requests are working fine in chrome but in firefox I get this CORS error:
  Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at <a href="http://remote.machine:8080/api/v1/provisioning/users/current-user" rel="noreferrer">http://remote.machine:8080/api/v1/provisioning/users/current-user</a>. This can be fixed by moving the resource to the same domain or enabling CORS.</p>
  
  <p>The Headers for the options request are as follows:</p>
  
  <pre><code>HTTP/1.1 200 OK
  Date: Wed, 24 Sep 2014 16:06:12 GMT
  X-Content-Type-Options: nosniff
  X-XSS-Protection: 1; mode=block
  Cache-Control: no-cache, no-store, max-age=0, must-revalidate
  Pragma: no-cache
  Expires: Thu, 01 Jan 1970 00:00:00 GMT
  X-Frame-Options: DENY
  Access-Control-Allow-Methods: GET, PUT, POST, OPTIONS, DELETE
  Access-Control-Max-Age: 3600
  Access-Control-Allow-Headers: Access-Control-Allow-Headers: Origin, Authorization, X-Requested-With, Content-Type, Accept
  Access-Control-Allow-Credentials: true
  Set-Cookie: JSESSIONID=eyv8cpnnfphy1b0121uzt293y;Path=/
  Content-Length: 0
  Server: Jetty(9.2.2.v20140723)
  </code></pre>
  
  <p>The angular request is set up as follows:</p>
  
  <pre><code>$http.get(AS_API_URL + '/provisioning/users/current-user', {
              headers: {
                  'Authorization': 'Basic ' + base64EncodedAuth               
              }
          });
  </code></pre>
  
  <p>For some reason these headers work fine in Chrome but not in Firefox, does anyone have a clue as to why? Do I need to provide more info?</p>
  
  <p>EDIT:</p>
  
  <p>Musa was right about the Access-Control-Allow-Headers being malformed.
  I edited the Jetty Server so the header now reads:</p>
  
  <pre><code>Access-Control-Allow-Headers: Origin, Authorization, X-Requested-With, Content-Type, Accept
  </code></pre>
  
  <p>I give my thanks to you Musa, you just saved my day :)</p>