Skip to content

Commit 0b8cf0c

Browse files
committed
Fix Win https plugin to support extra info in URL
1 parent 90d0058 commit 0b8cf0c

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

WinWebClientPlugin.cpp

+7-5
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,8 @@ TCByte* WinWebClientPlugin::fetchURL(const char* url, int& length, TCWebClient*
5959
}
6060
std::wstring hostName(urlComp.lpszHostName, urlComp.dwHostNameLength);
6161
std::wstring urlPath(urlComp.lpszUrlPath, urlComp.dwUrlPathLength);
62+
std::wstring extraInfo(urlComp.lpszExtraInfo, urlComp.dwExtraInfoLength);
63+
urlPath += extraInfo;
6264
HttpHandle hConnect = WinHttpConnect(hSession.get(),
6365
hostName.c_str(),
6466
INTERNET_DEFAULT_HTTPS_PORT,
@@ -135,11 +137,6 @@ TCByte* WinWebClientPlugin::fetchURL(const char* url, int& length, TCWebClient*
135137
{
136138
return NULL;
137139
}
138-
if (dwStatusCode != 200)
139-
{
140-
webClient->parseErrorResultCode((int)dwStatusCode);
141-
return NULL;
142-
}
143140
dwSize = 0;
144141
WinHttpQueryHeaders(hRequest.get(),
145142
WINHTTP_QUERY_RAW_HEADERS_CRLF,
@@ -162,6 +159,11 @@ TCByte* WinWebClientPlugin::fetchURL(const char* url, int& length, TCWebClient*
162159
wstringtoutf8(utf8HeaderData, headerData);
163160
std::string headers = "\r\n" + utf8HeaderData + "\r\n\r\n";
164161
webClient->parseHeaderFields(headers.c_str(), (int)headers.size());
162+
if (dwStatusCode != 200)
163+
{
164+
webClient->parseErrorResultCode((int)dwStatusCode);
165+
return NULL;
166+
}
165167
TCByte* result = NULL;
166168
length = 0;
167169
do

0 commit comments

Comments
 (0)