title: WCF URL host segment is changed to full domain name
body: <p>I have a page fetching HTML content from a WCF REST service via AJAX.  I started seeing errors on IE to the effect that "This page is accessing information that is not under its control...".  For some content, the WCF service will, instead of returning the content directly, return instead an object or iframe tag pointing back to itself with different parameters.  The WCF service sees a different URL than was requested, and the discrepancy causes the "security" error as IE thinks it's loading content from a different domain.</p>
  
  <p>So, for example, the XHR request asked for </p>
  
  <p>"<a href="http://localhost/Services/Content.svc?id=123" rel="nofollow noreferrer">http://localhost/Services/Content.svc?id=123</a>..."
  or even 
  "<a href="http://mymachine/Services/Content.svc?id=123" rel="nofollow noreferrer">http://mymachine/Services/Content.svc?id=123</a>..."</p>
  
  <p>As soon as the request reaches the WCF service, however, the URL is turned into:</p>
  
  <p>"<a href="http://mymachine.mydomain.com/Services/Content.svc?id=123" rel="nofollow noreferrer">http://mymachine.mydomain.com/Services/Content.svc?id=123</a>..."</p>
  
  <p>How can I get the originally requested URL within the WCF service?  I've inspected theWebOperationContext.Current.IncomingRequest.UriTemplateMatch properties to no avail, there is no remaining trace of "localhost".  I've also looked at the following posts and still cannot find the original URL:</p>
  
  <p><a href="https://stackoverflow.com/questions/444010/what-is-the-wcf-equivalent-of-httpcontext-current-request-rawurl">What is the WCF equivalent of HttpContext.Current.Request.RawUrl?</a></p>
  
  <p><a href="http://jstawski.com/archive/2008/05/01/wcf-wsdl-location-address-with-https.aspx" rel="nofollow noreferrer">http://jstawski.com/archive/2008/05/01/wcf-wsdl-location-address-with-https.aspx</a></p>
  
  <p>Is there any way to get to it?</p>