Ignore:
Timestamp:
Nov 7, 2001, 11:56:15 AM (24 years ago)
Author:
phaller
Message:

.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wininet/http.c

    r6712 r7290  
    1515#include "debugtools.h"
    1616#include "winerror.h"
     17#include <shlwapi.h>
    1718#include "winsock.h"
    1819
     
    223224    lpwhr->nSocketFD = INVALID_SOCKET;
    224225
    225     if (NULL != lpszObjectName && strlen(lpszObjectName))
    226         lpwhr->lpszPath = strdup(lpszObjectName);
     226    if (NULL != lpszObjectName && strlen(lpszObjectName)) {
     227        DWORD needed = 0;
     228        UrlEscapeA(lpszObjectName, NULL, &needed, URL_ESCAPE_SPACES_ONLY);
     229        lpwhr->lpszPath = HeapAlloc(GetProcessHeap(), 0, needed);
     230        UrlEscapeA(lpszObjectName, lpwhr->lpszPath, &needed,
     231                   URL_ESCAPE_SPACES_ONLY);
     232    }
    227233
    228234    if (NULL != lpszReferrer && strlen(lpszReferrer))
     
    601607    if (NULL == lpwhr->lpszPath)
    602608        lpwhr->lpszPath = strdup("/");
     609
     610    if(lpwhr->lpszPath[0] != '/') /* not an absolute path ?? --> fix it !! */
     611    {
     612        char *fixurl = HeapAlloc(GetProcessHeap(), 0, strlen(lpwhr->lpszPath) + 2);
     613        *fixurl = '/';
     614        strcpy(fixurl + 1, lpwhr->lpszPath);
     615        HeapFree( GetProcessHeap(), 0, lpwhr->lpszPath );
     616        lpwhr->lpszPath = fixurl;
     617    }
    603618
    604619    /* Calculate length of request string */
Note: See TracChangeset for help on using the changeset viewer.