From 8f5b1e4611bec0774ddfd6d95a0a52eac827b2c6 Mon Sep 17 00:00:00 2001 From: klzgrad Date: Sat, 20 Jun 2020 14:16:12 +0800 Subject: [PATCH] Fix extra-headers parsing in JSON config --- src/net/tools/naive/naive_proxy_bin.cc | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/net/tools/naive/naive_proxy_bin.cc b/src/net/tools/naive/naive_proxy_bin.cc index 0f97f781f3..352a161121 100644 --- a/src/net/tools/naive/naive_proxy_bin.cc +++ b/src/net/tools/naive/naive_proxy_bin.cc @@ -198,7 +198,7 @@ void GetCommandLineFromConfig(const base::FilePath& config_path, if (concurrency) { cmdline->concurrency = *concurrency; } - const auto* extra_headers = value->FindStringKey("extra_headers"); + const auto* extra_headers = value->FindStringKey("extra-headers"); if (extra_headers) { cmdline->extra_headers = *extra_headers; } @@ -304,6 +304,9 @@ bool ParseCommandLine(const CommandLine& cmdline, Params* params) { } params->extra_headers.AddHeadersFromString(cmdline.extra_headers); + if (!params->extra_headers.IsEmpty()) { + LOG(INFO) << "Using extra headers: " << params->extra_headers.ToString(); + } params->host_resolver_rules = cmdline.host_resolver_rules;