mirror of
https://github.com/sigp/lighthouse.git
synced 2026-03-22 14:24:44 +00:00
Set user agent on requests to builder (#4199)
## Issue Addressed Closes #4185 ## Proposed Changes - Set user agent to `Lighthouse/vX.Y.Z-<commit hash>` by default - Allow tweaking user agent via `--builder-user-agent "agent"`
This commit is contained in:
@@ -1000,6 +1000,15 @@ pub fn cli_app<'a, 'b>() -> App<'a, 'b> {
|
||||
.default_value("0")
|
||||
.takes_value(true)
|
||||
)
|
||||
.arg(
|
||||
Arg::with_name("builder-user-agent")
|
||||
.long("builder-user-agent")
|
||||
.value_name("STRING")
|
||||
.help("The HTTP user agent to send alongside requests to the builder URL. The \
|
||||
default is Lighthouse's version string.")
|
||||
.requires("builder")
|
||||
.takes_value(true)
|
||||
)
|
||||
.arg(
|
||||
Arg::with_name("count-unrealized")
|
||||
.long("count-unrealized")
|
||||
|
||||
@@ -329,6 +329,9 @@ pub fn get_config<E: EthSpec>(
|
||||
let payload_builder =
|
||||
parse_only_one_value(endpoint, SensitiveUrl::parse, "--builder", log)?;
|
||||
el_config.builder_url = Some(payload_builder);
|
||||
|
||||
el_config.builder_user_agent =
|
||||
clap_utils::parse_optional(cli_args, "builder-user-agent")?;
|
||||
}
|
||||
|
||||
// Set config values from parse values.
|
||||
|
||||
Reference in New Issue
Block a user