Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(206)

Unified Diff: util/net/http_transport_win.cc

Issue 1317023003: win: Pass WINHTTP_FLAG_SECURE when necessary (Closed) Base URL: https://chromium.googlesource.com/crashpad/crashpad@handler-exe-with-uuid
Patch Set: dcheck nScheme Created 5 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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;
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698