<html>
    <head>
      <base href="https://bugs.webkit.org/" />
    </head>
    <body>
      <p>
        <div>
            <b><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - XHR Remove Headers"
   href="https://bugs.webkit.org/show_bug.cgi?id=160432#c1">Comment # 1</a>
              on <a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - XHR Remove Headers"
   href="https://bugs.webkit.org/show_bug.cgi?id=160432">bug 160432</a>
              from <span class="vcard"><a class="email" href="mailto:youennf&#64;gmail.com" title="youenn fablet &lt;youennf&#64;gmail.com&gt;"> <span class="fn">youenn fablet</span></a>
</span></b>
        <pre>XHR is a rather high level API that works well in most cases but lacks some flexibility.
You might want to look at the fetch API which gives more flexibility to the web developper.
For instance, with the fetch API, there is an option to control the referrer.

To be noted though that some headers cannot be let under the control of the web application for security purposes.

I don't think that there is a way to remove all headers you want with the fetch API.
That said, HTTP/2 uses HPACK for header representation and for the headers you are mentioning (except referer), it will be very good at representing them in a few bytes.

So my suggestion would be to migrate to HTTP/2 and start using the fetch API wherever available.</pre>
        </div>
      </p>
      <hr>
      <span>You are receiving this mail because:</span>
      
      <ul>
          <li>You are the assignee for the bug.</li>
      </ul>
    </body>
</html>