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

Unified Diff: net/test/spawned_test_server/base_test_server.cc

Issue 336263005: Map WebSocket URL schemes to HTTP URL schemes for auth purposes. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Replace accidentally removed #include <string> Created 6 years, 5 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
Index: net/test/spawned_test_server/base_test_server.cc
diff --git a/net/test/spawned_test_server/base_test_server.cc b/net/test/spawned_test_server/base_test_server.cc
index c0fc6c5fc8f3e369b97c5864a9defaab2a6e90f7..26608c63bbd561d638a96a81b6d99afb2bd37acd 100644
--- a/net/test/spawned_test_server/base_test_server.cc
+++ b/net/test/spawned_test_server/base_test_server.cc
@@ -165,7 +165,8 @@ const char BaseTestServer::kLocalhost[] = "127.0.0.1";
BaseTestServer::BaseTestServer(Type type, const std::string& host)
: type_(type),
started_(false),
- log_to_console_(false) {
+ log_to_console_(false),
+ ws_basic_auth_(false) {
Init(host);
}
@@ -173,7 +174,8 @@ BaseTestServer::BaseTestServer(Type type, const SSLOptions& ssl_options)
: ssl_options_(ssl_options),
type_(type),
started_(false),
- log_to_console_(false) {
+ log_to_console_(false),
+ ws_basic_auth_(false) {
DCHECK(UsingSSL(type));
Init(GetHostname(type, ssl_options));
}
@@ -384,6 +386,11 @@ bool BaseTestServer::GenerateArguments(base::DictionaryValue* arguments) const {
if (VLOG_IS_ON(1) || log_to_console_)
arguments->Set("log-to-console", base::Value::CreateNullValue());
+ if (ws_basic_auth_) {
+ DCHECK(type_ == TYPE_WS || type_ == TYPE_WSS);
+ arguments->Set("ws-basic-auth", base::Value::CreateNullValue());
+ }
+
if (UsingSSL(type_)) {
// Check the certificate arguments of the HTTPS server.
base::FilePath certificate_path(certificates_dir_);

Powered by Google App Engine
This is Rietveld 408576698