title: Cypress - Add custom header for all XHR requests
body: <p>I notice that <code>X-CSRFToken</code> header is getting removed between tests, for all the XHR requests that triggered from application under test. I'm not sure to preserve this header, as I'm already preserving the Cookies through <code>Cypress.Cookies.preserveOnce('sessionid', 'csrftoken')</code></p>
  
  <p>Hence, I thought of appending the custom header <code>X-CSRFToken</code> to all the XHR requests from the application. Here is the script I used, where I'm fetching the <code>csrftoken</code> from cookies and setting to custom header.</p>
  
  <pre><code>cy.server({
     onAnyRequest: function(route, proxy) {
          proxy.xhr.setRequestHeader('X-CSRFToken', cy.getCookie('csrftoken'));
     }
  })
  </code></pre>
  
  <p>Here, I'm getting the below error,</p>
  
  <pre><code>Argument of type '{ onAnyRequest: (route: any, proxy: any) =&gt; void; }' is not assignable to parameter of type 'Partial&lt;ServerOptions&gt;'.
    Object literal may only specify known properties, and 'onAnyRequest' does not exist in type 'Partial&lt;ServerOptions&gt;'.
  </code></pre>
  
  <p>I'm expecting any working solution to this approach or a better solution.</p>