Index: util/net/http_transport_win.cc |
diff --git a/util/net/http_transport_win.cc b/util/net/http_transport_win.cc |
index 2b6e372f50ff9b9ba4265d01f042e7a496f87b91..1fa1810b7e0091d08079d2f98c5515d13c22bb40 100644 |
--- a/util/net/http_transport_win.cc |
+++ b/util/net/http_transport_win.cc |
@@ -119,6 +119,8 @@ bool HTTPTransportWin::ExecuteSynchronously(std::string* response_body) { |
LogErrorWinHttpMessage("WinHttpCrackUrl"); |
return false; |
} |
+ DCHECK(url_components.nScheme == INTERNET_SCHEME_HTTP || |
+ url_components.nScheme == INTERNET_SCHEME_HTTPS); |
std::wstring host_name(url_components.lpszHostName, |
url_components.dwHostNameLength); |
std::wstring url_path(url_components.lpszUrlPath, |
@@ -133,14 +135,15 @@ bool HTTPTransportWin::ExecuteSynchronously(std::string* response_body) { |
return false; |
} |
- ScopedHINTERNET request( |
- WinHttpOpenRequest(connect.get(), |
- base::UTF8ToUTF16(method()).c_str(), |
- url_path.c_str(), |
- nullptr, |
- WINHTTP_NO_REFERER, |
- WINHTTP_DEFAULT_ACCEPT_TYPES, |
- 0)); |
+ ScopedHINTERNET request(WinHttpOpenRequest( |
+ connect.get(), |
+ base::UTF8ToUTF16(method()).c_str(), |
+ url_path.c_str(), |
+ nullptr, |
+ WINHTTP_NO_REFERER, |
+ WINHTTP_DEFAULT_ACCEPT_TYPES, |
+ url_components.nScheme == INTERNET_SCHEME_HTTPS ? WINHTTP_FLAG_SECURE |
+ : 0)); |
if (!request.get()) { |
LogErrorWinHttpMessage("WinHttpOpenRequest"); |
return false; |