Dan Hipschman : wininet: Remove custom content-length/ type headers from redirects.
Alexandre Julliard
julliard at winehq.org
Wed Apr 23 07:59:25 CDT 2008
Module: wine
Branch: master
Commit: a1ebffb4527e083d3a39762851fbc3d76b5ecfa4
URL: http://source.winehq.org/git/wine.git/?a=commit;h=a1ebffb4527e083d3a39762851fbc3d76b5ecfa4
Author: Dan Hipschman <dsh at linux.ucla.edu>
Date: Tue Apr 22 15:48:28 2008 -0700
wininet: Remove custom content-length/type headers from redirects.
---
dlls/wininet/http.c | 11 +++++++++++
1 files changed, 11 insertions(+), 0 deletions(-)
diff --git a/dlls/wininet/http.c b/dlls/wininet/http.c
index c47a994..3f50d5c 100644
--- a/dlls/wininet/http.c
+++ b/dlls/wininet/http.c
@@ -2861,10 +2861,13 @@ static BOOL HTTP_GetRequestURL(WININETHTTPREQW *req, LPWSTR buf)
*/
static BOOL HTTP_HandleRedirect(LPWININETHTTPREQW lpwhr, LPCWSTR lpszUrl)
{
+ static const WCHAR szContentType[] = {'C','o','n','t','e','n','t','-','T','y','p','e',0};
+ static const WCHAR szContentLength[] = {'C','o','n','t','e','n','t','-','L','e','n','g','t','h',0};
LPWININETHTTPSESSIONW lpwhs = lpwhr->lpHttpSession;
LPWININETAPPINFOW hIC = lpwhs->lpAppInfo;
BOOL using_proxy = hIC->lpszProxy && hIC->lpszProxy[0];
WCHAR path[INTERNET_MAX_URL_LENGTH];
+ int index;
if(lpszUrl[0]=='/')
{
@@ -3051,6 +3054,14 @@ static BOOL HTTP_HandleRedirect(LPWININETHTTPREQW lpwhr, LPCWSTR lpszUrl)
}
}
+ /* Remove custom content-type/length headers on redirects. */
+ index = HTTP_GetCustomHeaderIndex(lpwhr, szContentType, 0, TRUE);
+ if (0 <= index)
+ HTTP_DeleteCustomHeader(lpwhr, index);
+ index = HTTP_GetCustomHeaderIndex(lpwhr, szContentLength, 0, TRUE);
+ if (0 <= index)
+ HTTP_DeleteCustomHeader(lpwhr, index);
+
return TRUE;
}
More information about the wine-cvs
mailing list