When setting the referer header on an HttpWebRequest I'm seeing two different behaviors. On some sites the referer header will remain as each redirect is followed while on others the referer header is dropped after the first request. What would cause this behavior and is there a way to control it?
Sample (this appears to be HTTPS specific but am not sure why)
In this request the header will be dropped on the redirect.
HttpWebRequest request = (HttpWebRequest)WebRequest.Create("https://mail.google.com/mail/");
request.Referer = "http://www.google.com";
HttpWebResponse response = (HttpWebResponse)request.GetResponse();
In this request the header remains on each redirect followed. The difference in the second request is http vs https.
HttpWebRequest request = (HttpWebRequest)WebRequest.Create("http://mail.google.com/mail/");
request.Referer = "http://www.google.com";
HttpWebResponse response = (HttpWebResponse)request.GetResponse();