title: python requests - remove headers on redirect
body: <p>I'm using the python requests library for some http checking on an application. I have a situation where I need to send in an initial host header on the requests, but this should not be used when following redirects where it is causing a problem.</p>
  
  <p>I've had a look around the request docs but I can't see a way I can have requests drop the request headers when following redirects. </p>
  
  <p>Here is an example of my problem</p>
  
  <pre><code>import requests
  from requests.structures import CaseInsensitiveDict
  
  s = requests.Session()
  request_headers = CaseInsensitiveDict()
  request_headers['host'] = 'google.co.uk'
  
  response = s.get("http://google.co.uk",allow_redirects=True,headers=request_headers)
  </code></pre>
  
  <p>In this case google.co.uk will redirect to <a href="https://www.google.co.uk" rel="nofollow">https://www.google.co.uk</a>, but get stuck in a loop because it will send the host header set to 'google.co.uk' even after it follows the redirect. </p>
  
  <p>I always need to use manual host header on the first request due to this going through a CDN which uses a header to determine the site it is serving for. Removing it from the initial request is not an option. </p>
  
  <p>Here is an equivalent curl, which does drop the host header after the initial request. This is the behaviour I would like to see / expect from Python Requests</p>
  
  <pre><code>curl -H "Host: google.co.uk" http://google.co.uk -L -o /dev/null 
  </code></pre>