Skip to content

Commit

Permalink
Add new setting to skip HEAD requests for localhost servers
Browse files Browse the repository at this point in the history
  • Loading branch information
joshwatson committed May 31, 2024
1 parent 3302252 commit 7546cb3
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions rust/examples/pdb-ng/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -252,6 +252,14 @@ fn sym_store_exists(path: &String) -> Result<bool> {
if !Settings::new("").get_bool("network.pdbAutoDownload", None, None) {
return Err(anyhow!("Auto download disabled"));
}

// If the user doesn't want to check the network path
// (in the case of using a symbol server proxy that doesn't accept HEAD requests),
// just assume the path exists and return true.
if path.contains("localhost:") && Settings::new("").get_bool("network.pdbSkipNetworkPathCheck", None, None) {
return Ok(true);
}

info!("HEAD: {}", path);

// Download from remote
Expand Down Expand Up @@ -756,6 +764,18 @@ fn init_plugin() -> bool {
}"#,
);

settings.register_setting_json(
"network.pdbSkipNetworkPathCheck",
r#"{
"title" : "Skip Network Path Check",
"type" : "boolean",
"default" : false,
"aliases" : ["pdb.SkipNetworkPathCheck", "pdb.skip-network-path-check"],
"description" : "Skip the HEAD http request that verifies if a PDB network path exists (only for localhost servers).",
"ignore" : []
}"#,
);

settings.register_setting_json(
"pdb.files.symbolServerList",
r#"{
Expand Down

0 comments on commit 7546cb3

Please sign in to comment.