mshtml: Set referer HTTP header in nsIHttpChannel::SetReferrerWithPolicy.

Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Jacek Caban 2016-08-03 15:53:20 +02:00 committed by Alexandre Julliard
parent 3cb45c4c8d
commit 0ff1b0c382
1 changed files with 8 additions and 0 deletions

View File

@ -1303,7 +1303,11 @@ static nsresult NSAPI nsChannel_SetReferrerWithPolicy(nsIHttpChannel *iface, nsI
nsChannel *This = impl_from_nsIHttpChannel(iface); nsChannel *This = impl_from_nsIHttpChannel(iface);
DWORD channel_scheme, referrer_scheme; DWORD channel_scheme, referrer_scheme;
nsWineURI *referrer; nsWineURI *referrer;
BSTR referrer_uri;
nsresult nsres; nsresult nsres;
HRESULT hres;
static const WCHAR refererW[] = {'R','e','f','e','r','e','r'};
TRACE("(%p)->(%p %d)\n", This, aReferrer, aReferrerPolicy); TRACE("(%p)->(%p %d)\n", This, aReferrer, aReferrerPolicy);
@ -1338,6 +1342,10 @@ static nsresult NSAPI nsChannel_SetReferrerWithPolicy(nsIHttpChannel *iface, nsI
return NS_OK; return NS_OK;
} }
hres = IUri_GetDisplayUri(referrer->uri, &referrer_uri);
if(SUCCEEDED(hres) )
set_http_header(&This->request_headers, refererW, sizeof(refererW)/sizeof(WCHAR), referrer_uri, SysStringLen(referrer_uri));
This->referrer = (nsIURI*)&referrer->nsIFileURL_iface; This->referrer = (nsIURI*)&referrer->nsIFileURL_iface;
return NS_OK; return NS_OK;
} }