title: 302 Response Error
body: <p>I am making a GET request to my local webservice which I am expecting a 302 response to be returned with a location in the header. However, I get an undefined response back and a network error even though I can see locally that the request is being served and response is being created without any errors in the webservice.</p>
  
  <p>I have tried in Postman and Chrome, and it receives the redirect response and redirects accordingly.</p>
  
  <p>I'm not sure if this is a CORS problem and if so, how can I solve this?</p>
  
  <p>I've already added in the response header for CORS filter </p>
  
  <pre><code>Access-Control-Expose-Headers: Location, [own headers]
  Access-Control-Allow-Origin: '*'
  Access-Control-Allow-Methods: POST, PUT, GET, OPTIONS, DELETE
  Access-Control-Max-Age: [some age]
  Access-Control-Allow-Headers: [own headers]
  </code></pre>
  
  <p>And the location is present in the header when I use Postman</p>
  
  <p>The request I am making using Axios and the config is</p>
  
  <pre><code>const config = {
    url: [someURL],
    method: 'GET',
    headers: {
      'customHeader':'token',
    },
    params: {
      [params]
    },
    maxRedirects: 0,
    validateStatus: status =&gt; (status &gt;= 200 &amp;&amp; status &lt; 300) || status === 302,
  };
  </code></pre>
  
  <p>Any help would really be appreciated as to why the response is undefined when it reaches my JS code, but works fine in Postman and Chrome.</p>
  
  <p>A way I could resolve this is to use HTTP status code 200 and get the location header to redirect, but I want to avoid this because it is technically a redirect response.</p>