Merge pull request #222 from deepak1556/disable_http2_patch

flag to disable HTTP/2 and SPDY/3.1 protocols
This commit is contained in:
Cheng Zhao 2016-05-19 10:21:23 +00:00
commit 7d126e1734

View file

@ -89,6 +89,9 @@ const char kProxyBypassList[] = "proxy-bypass-list";
// Uses the pac script at the given URL.
const char kProxyPacUrl[] = "proxy-pac-url";
// Disable HTTP/2 and SPDY/3.1 protocols.
const char kDisableHttp2[] = "disable-http2";
} // namespace
@ -341,7 +344,12 @@ net::URLRequestContext* URLRequestContextGetter::GetURLRequestContext() {
network_session_params.http_auth_handler_factory =
url_request_context_->http_auth_handler_factory();
network_session_params.net_log = url_request_context_->net_log();
network_session_params.enable_http2 = true;
// --disable-http2
if (command_line.HasSwitch(kDisableHttp2)) {
network_session_params.enable_spdy31 = false;
network_session_params.enable_http2 = false;
}
// --ignore-certificate-errors
if (command_line.HasSwitch(switches::kIgnoreCertificateErrors))