From c0ea45ad6a3645968c844aef3171a3622660a40f Mon Sep 17 00:00:00 2001 From: Lei Zhang Date: Wed, 21 May 2008 19:04:10 -0700 Subject: [PATCH] wininet: send https scheme to proxy server when appropriate. --- dlls/wininet/http.c | 8 ++++++-- 1 files changed, 6 insertions(+), 2 deletions(-) diff --git a/dlls/wininet/http.c b/dlls/wininet/http.c index a70bcff..119b49b 100644 --- a/dlls/wininet/http.c +++ b/dlls/wininet/http.c @@ -1263,14 +1263,18 @@ static WCHAR *HTTP_BuildProxyRequestUrl(WININETHTTPREQW *req) { static const WCHAR slash[] = { '/',0 }; static const WCHAR format[] = { 'h','t','t','p',':','/','/','%','s',':','%','d',0 }; + static const WCHAR formatSSL[] = { 'h','t','t','p','s',':','/','/','%','s',':','%','d',0 }; WININETHTTPSESSIONW *session = req->lpHttpSession; - size = 15; /* "http://" + sizeof(port#) + ":/\0" */ + size = 16; /* "https://" + sizeof(port#) + ":/\0" */ size += strlenW( session->lpszHostName ) + strlenW( req->lpszPath ); if (!(url = HeapAlloc( GetProcessHeap(), 0, size * sizeof(WCHAR) ))) return NULL; - sprintfW( url, format, session->lpszHostName, session->nHostPort ); + if (req->hdr.dwFlags & INTERNET_FLAG_SECURE) + sprintfW( url, formatSSL, session->lpszHostName, session->nHostPort ); + else + sprintfW( url, format, session->lpszHostName, session->nHostPort ); if (req->lpszPath[0] != '/') strcatW( url, slash ); strcatW( url, req->lpszPath ); } -- 1.5.3.6