Commit 0aebee98 authored by Huw D M Davies's avatar Huw D M Davies Committed by Alexandre Julliard

Escape any spaces in lpszObjectName passed to HttpOpenRequest.

parent 990b480a
......@@ -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);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment