diff --git a/dlls/wininet/http.c b/dlls/wininet/http.c index 41611dc326c..fe127897f5a 100644 --- a/dlls/wininet/http.c +++ b/dlls/wininet/http.c @@ -605,6 +605,15 @@ BOOL WINAPI HTTP_HttpSendRequestA(HINTERNET hHttpRequest, LPCSTR lpszHeaders, if (NULL == lpwhr->lpszPath) lpwhr->lpszPath = HTTP_strdup("/"); + if(lpwhr->lpszPath[0] != '/') /* not an absolute path ?? --> fix it !! */ + { + char *fixurl = HeapAlloc(GetProcessHeap(), 0, strlen(lpwhr->lpszPath) + 2); + *fixurl = '/'; + strcpy(fixurl + 1, lpwhr->lpszPath); + HeapFree( GetProcessHeap(), 0, lpwhr->lpszPath ); + lpwhr->lpszPath = fixurl; + } + /* Calculate length of request string */ requestStringLen = strlen(lpwhr->lpszVerb) + diff --git a/dlls/wininet/utility.c b/dlls/wininet/utility.c index 224d9490b13..53601fe3230 100644 --- a/dlls/wininet/utility.c +++ b/dlls/wininet/utility.c @@ -113,9 +113,28 @@ time_t ConvertTimeString(LPCSTR asctime) BOOL GetAddress(LPCSTR lpszServerName, INTERNET_PORT nServerPort, struct hostent **phe, struct sockaddr_in *psa) { + char *found; + TRACE("%s\n", lpszServerName); - *phe = gethostbyname(lpszServerName); + /* Validate server name first + * Check if there is sth. like + * pinger.macromedia.com:80 + * if yes, eliminate the :80.... + */ + found = strchr(lpszServerName, ':'); + if (found) + { + int len = found - lpszServerName; + char *new = HeapAlloc(GetProcessHeap(), 0, len + 1); + memcpy( new, lpszServerName, len ); + new[len] = '\0'; + TRACE("Found a ':' inside the server name, reparsed name: %s\n", new); + *phe = gethostbyname(new); + HeapFree( GetProcessHeap(), 0, new ); + } + else *phe = gethostbyname(lpszServerName); + if (NULL == *phe) { TRACE("Failed to get hostname: (%s)\n", lpszServerName);