title: Axios, fetch() setting request headers into Access-Control-Request-Headers instead of separate headers
body: <p>I am trying to make a GET request with some custom headers from a react application.</p>
  
  <p>This is the code for the axios interceptor:</p>
  
  <pre><code>addCaptchaHeaders(captcha, sgn, exp) {
      // remove the old captcha headers
      if (this.captchaHeadersInterceptor !== undefined) {
        this.removeCaptchaHeader();
      }
      // Sign new captcha headers
      this.captchaHeadersInterceptor = this.httpClient.interceptors.request.use(
        config =&gt; {
          // Add headers here
          config.headers.common._captcha = captcha;
          config.headers.common._sgn = sgn;
          config.headers.common._exp = exp;
          return config;
        },
        error =&gt; {
          // Do something with request error
          return Promise.reject(error);
        }
      );
    }
  </code></pre>
  
  <p>These are the response headers for the preflight request:</p>
  
  <pre><code>Access-Control-Allow-Headers: origin, content-type, accept, authorization, _captcha, _sgn, _exp
  Content-Length: 0
  Server: Jetty(9.3.24.v20180605)
  </code></pre>
  
  <p>These are the request headers for the preflight request:</p>
  
  <pre><code>Accept: */*
  Accept-Encoding: gzip, deflate, br
  Accept-Language: en-US,en;q=0.9,sl;q=0.8
  Access-Control-Request-Headers: _captcha,_exp,_sgn
  Access-Control-Request-Method: GET
  Connection: keep-alive
  Host: localhost:8086
  Origin: http://localhost:3000
  User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/69.0.3497.92 Safari/537.36
  </code></pre>
  
  <p>The headers for the actual request after the preflight one are the same. So <code>Access-Control-Request-Headers: _captcha,_exp,_sgn</code> instead of custom request headers.</p>
  
  <p>Thinking it was an axios configuration issue I made the same request using fetch:</p>
  
  <pre><code>fetch(
        "http://localhost:8086/podatki/parcela/search?parcela=1727&amp;count=50&amp;offset=0",
        {
          method: "GET",
          headers: {
            _captcha: res,
            _sgn: sgn,
            _exp: exp
          }
        }
      );
  </code></pre>
  
  <p>The result is the same.</p>
  
  <p>Is this an issue with the browser-server communication? If so are there some things missing from the response headers?</p>
  
  <p>Doing the same request with postman works.</p>