title: Angular 5 disable header check with HttpClient / HttpHeader
body: <p>I'm using Angular's HttpClient and HttpHeader to make a request to the api of a particular web game. The api does an origin check along with some other header based checks. When trying to set the Host, Referer, Accept-Encoding, User-Agent, Origin, and Connection headers Angular refuses with the message "Refused to set unsafe header '.'" Is there any way I can disable safe header checks similar to the method in AJAX?</p>
  
  <p>Here is an example of disabling safe header checks in ajax:</p>
  
  <p><code>$.ajax({
          type: type,
          url: url,
          headers: headers,
          data: data,
          beforeSend: function(xmlHttpRequest) {
              // Requires node-XMLHttpRequest version 1.5.1 or later to set some headers in Node.js
              if(xmlHttpRequest.setDisableHeaderCheck) 
                xmlHttpRequest.setDisableHeaderCheck(true);
              return true;
          }
      })</code></p>
  
  <p>This is the header I'm trying to set: </p>
  
  <p><code>headers = headers.set('Accept-Language', 'en-US,en;q=0.8')
                       .set('Host', '&lt;game-host&gt;')
                       .set('Referer', '&lt;game-domain&gt;')
                       .set('Accept-Encoding', 'gzip, deflate, sdch')
                       .set('User-Agent', 'Mozilla/5.0 (Windows NT 6.3 WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/39.0.2171.65 Safari/537.36')
                       .set('&lt;game-name&gt;-Session', 'ap_session=undefined')
                       .set('Origin', '&lt;game-domain&gt;')
                       .set('Connection', 'keep-alive')
                       .set('Accept', 'application/json, text/javascript, */* q=0.01')
                       .set('Content-Type', 'application/json charset=utf-8')
                       .set('&lt;agent&gt;', '1|Web-FB|Chrome 39.0.2171.65|0|Windows|0|1.1||en||1')
                       .set('&lt;referer-string&gt;', 'true');</code></p>