Escape any spaces in lpszObjectName passed to HttpOpenRequest.

This commit is contained in:
Huw D M Davies 2001-01-21 21:09:00 +00:00 committed by Alexandre Julliard
parent 990b480a1d
commit 0aebee9825
1 changed files with 8 additions and 2 deletions

View File

@ -15,6 +15,7 @@
#include "debugtools.h"
#include "winerror.h"
#include "winsock.h"
#include "shlwapi.h"
#include <sys/types.h>
#ifdef HAVE_SYS_SOCKET_H
@ -222,8 +223,13 @@ INTERNETAPI HINTERNET WINAPI HTTP_HttpOpenRequestA(HINTERNET hHttpSession,
lpwhr->hdr.dwContext = dwContext;
lpwhr->nSocketFD = INVALID_SOCKET;
if (NULL != lpszObjectName && strlen(lpszObjectName))
lpwhr->lpszPath = HTTP_strdup(lpszObjectName);
if (NULL != lpszObjectName && strlen(lpszObjectName)) {
DWORD needed = 0;
UrlEscapeA(lpszObjectName, NULL, &needed, URL_ESCAPE_SPACES_ONLY);
lpwhr->lpszPath = HeapAlloc(GetProcessHeap(), 0, needed);
UrlEscapeA(lpszObjectName, lpwhr->lpszPath, &needed,
URL_ESCAPE_SPACES_ONLY);
}
if (NULL != lpszReferrer && strlen(lpszReferrer))
HTTP_ProcessHeader(lpwhr, HTTP_REFERER, lpszReferrer, HTTP_ADDHDR_FLAG_COALESCE);