title: Unable to access response headers with response.headers in a createAsyncThunk Fetch Request
body: <p>This is my fetch request in <code>playerSlice.js</code>:</p>
  <pre><code>export const fetchPlayer = createAsyncThunk(
    &quot;players/fetchPlayer&quot;,
    async (payload) =&gt; {
      const options = {
        method: &quot;GET&quot;,
        mode: &quot;cors&quot;,
        credentials: &quot;include&quot;,
        headers: {
          &quot;Content-Type&quot;: &quot;application/json&quot;,
          &quot;Accept&quot;: &quot;application/json&quot;,
          &quot;AgentId&quot;: `${localStorage.agentId}` ? `${localStorage.agentId}` : null
        },
      };
      // console.log(options)
      const response = await fetch(
        `URL HERE`,
        options
      );
  
      if (response.ok) {
        console.log(response.headers)
        const player = await response.json();
        console.log(player)
        return { ...player };
      }
    }
  );
  </code></pre>
  <p>The <code>console.log(player)</code> works as expected, i.e., I am in fact getting the response, but when I check <code>response.headers</code> it's an empty object even though I've allowed and exposed headers on the server???</p>
  <p><a href="https://i.stack.imgur.com/bah3k.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/bah3k.jpg" alt="headers object" /></a></p>
  <p>CORS setup on node/express side is as follows:</p>
  <pre><code>app.use(
    cors({
      &quot;origin&quot;: &quot;http://localhost:3001&quot;,
      &quot;methods&quot;: [&quot;GET&quot;, &quot;PUT&quot;, &quot;POST&quot;, &quot;PATCH&quot;, &quot;DELETE&quot;],
      &quot;allowedHeaders&quot;: [&quot;Content-Type&quot;, &quot;AgentId&quot;, &quot;Accept&quot;],
      &quot;exposedHeaders&quot;: [&quot;Content-Type&quot;, &quot;AgentId&quot;, &quot;Accept&quot;],
      &quot;credentials&quot;: true,
    })
  );
  app.use(express.json());
  app.use('/', public)
  </code></pre>
  <p>And I'm setting the custom header server side:</p>
  <pre><code>res.header('AgentId', agentId)
  res.status(200).send({...REMOVED FOR BREVITY});
  </code></pre>
  <p>Am I doing something wrong here?</p>
  <p>P.S. This is my first project using <code>redux/toolkit</code></p>