mirror of
https://github.com/sigp/lighthouse.git
synced 2026-05-07 16:55:46 +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:
@@ -716,6 +716,40 @@ fn builder_fallback_flags() {
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn builder_user_agent() {
|
||||
run_payload_builder_flag_test_with_config(
|
||||
"builder",
|
||||
"http://meow.cats",
|
||||
None,
|
||||
None,
|
||||
|config| {
|
||||
assert_eq!(
|
||||
config.execution_layer.as_ref().unwrap().builder_user_agent,
|
||||
None
|
||||
);
|
||||
},
|
||||
);
|
||||
run_payload_builder_flag_test_with_config(
|
||||
"builder",
|
||||
"http://meow.cats",
|
||||
Some("builder-user-agent"),
|
||||
Some("anon"),
|
||||
|config| {
|
||||
assert_eq!(
|
||||
config
|
||||
.execution_layer
|
||||
.as_ref()
|
||||
.unwrap()
|
||||
.builder_user_agent
|
||||
.as_ref()
|
||||
.unwrap(),
|
||||
"anon"
|
||||
);
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
fn run_jwt_optional_flags_test(jwt_flag: &str, jwt_id_flag: &str, jwt_version_flag: &str) {
|
||||
use sensitive_url::SensitiveUrl;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user