title: Custom Request Headers within TestCafe are not displayed
body: <p>I have tried a handful of different things and bounced between different suggestions on what could be the problem without any luck.  Ultimately I need to test certain aspects of an application that is behind a feature flag which can be accessed with request headers.</p>
  <p>I may be trying to accomplish something that isn't possible with this implementation, but I have attached my code sample below, and the logs generated below that.  I expected the added header to be present in the log output.</p>
  <p><em>Code:</em></p>
  <pre><code>
  class myRequestHook extends RequestHook {
    constructor () {
      super()
    }
  
    async onRequest (e) {
      e.requestOptions.headers['test-header'] = 'test-value'
    }
  
    async onResponse (e) {
  
    }
  }
  
  const customHook = new myRequestHook()
  const customLogger = RequestLogger('http://example.com', { logRequestHeaders: true })
  
  fixture ('Request fixture')
    .page('http://example.com/')
    .requestHooks( [ customLogger, customHook ])
  
  test('Request test', async () =&gt; {
    console.log(customLogger.requests[0].request.headers)
  })
  </code></pre>
  <p><em>Logs:</em></p>
  <pre><code>{
    host: 'example.com',
    connection: 'keep-alive',
    'sec-ch-ua': '&quot; Not A;Brand&quot;;v=&quot;99&quot;, &quot;Chromium&quot;;v=&quot;102&quot;, &quot;Google Chrome&quot;;v=&quot;102&quot;',
    'sec-ch-ua-mobile': '?0',
    'sec-ch-ua-platform': '&quot;macOS&quot;',
    'upgrade-insecure-requests': '1',
    'user-agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/102.0.5005.115 Safari/537.36',
    accept: 'text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9',
    'sec-fetch-site': 'same-origin',
    'sec-fetch-mode': 'navigate',
    'sec-fetch-dest': 'document',
    'accept-encoding': 'gzip, deflate, br',
    'accept-language': 'en-US,en;q=0.9'
  }
  </code></pre>