Hans Leidekker : wininet: Fix handling of host and referrer headers in HttpOpenRequest.
Alexandre Julliard
julliard at winehq.org
Mon Jan 7 08:38:57 CST 2008
Module: wine
Branch: master
Commit: 4d84eb26d011df52694b47c5dfc2e42548072416
URL: http://source.winehq.org/git/wine.git/?a=commit;h=4d84eb26d011df52694b47c5dfc2e42548072416
Author: Hans Leidekker <hans at it.vu.nl>
Date: Fri Jan 4 13:14:00 2008 +0100
wininet: Fix handling of host and referrer headers in HttpOpenRequest.
---
dlls/wininet/http.c | 20 ++------------------
1 files changed, 2 insertions(+), 18 deletions(-)
diff --git a/dlls/wininet/http.c b/dlls/wininet/http.c
index 098d7d2..c996e0c 100644
--- a/dlls/wininet/http.c
+++ b/dlls/wininet/http.c
@@ -1413,7 +1413,7 @@ HINTERNET WINAPI HTTP_HttpOpenRequestW(LPWININETHTTPSESSIONW lpwhs,
}
if (NULL != lpszReferrer && strlenW(lpszReferrer))
- HTTP_ProcessHeader(lpwhr, HTTP_REFERER, lpszReferrer, HTTP_ADDHDR_FLAG_COALESCE);
+ HTTP_ProcessHeader(lpwhr, HTTP_REFERER, lpszReferrer, HTTP_ADDREQ_FLAG_ADD | HTTP_ADDHDR_FLAG_REQ);
if (lpszAcceptTypes)
{
@@ -1436,23 +1436,7 @@ HINTERNET WINAPI HTTP_HttpOpenRequestW(LPWININETHTTPSESSIONW lpwhs,
else if (strlenW(lpszVerb))
lpwhr->lpszVerb = WININET_strdupW(lpszVerb);
- if (NULL != lpszReferrer && strlenW(lpszReferrer))
- {
- WCHAR buf[MAXHOSTNAME];
- URL_COMPONENTSW UrlComponents;
-
- buf[0] = '\0';
- memset( &UrlComponents, 0, sizeof UrlComponents );
- UrlComponents.dwStructSize = sizeof UrlComponents;
- UrlComponents.lpszHostName = buf;
- UrlComponents.dwHostNameLength = MAXHOSTNAME;
-
- if (InternetCrackUrlW(lpszReferrer, 0, 0, &UrlComponents) &&
- strlenW(UrlComponents.lpszHostName))
- HTTP_ProcessHeader(lpwhr, szHost, UrlComponents.lpszHostName, HTTP_ADDREQ_FLAG_ADD | HTTP_ADDREQ_FLAG_REPLACE | HTTP_ADDHDR_FLAG_REQ);
- }
- else
- HTTP_ProcessHeader(lpwhr, szHost, lpwhs->lpszHostName, HTTP_ADDREQ_FLAG_ADD | HTTP_ADDREQ_FLAG_REPLACE | HTTP_ADDHDR_FLAG_REQ);
+ HTTP_ProcessHeader(lpwhr, szHost, lpwhs->lpszHostName, HTTP_ADDREQ_FLAG_ADD | HTTP_ADDHDR_FLAG_REQ);
if (lpwhs->nServerPort == INTERNET_INVALID_PORT_NUMBER)
lpwhs->nServerPort = (dwFlags & INTERNET_FLAG_SECURE ?
More information about the wine-cvs
mailing list