Have a user agent for online PCI ID database updating

This commit is contained in:
Ilya Zlobintsev
2021-03-01 22:31:30 +02:00
parent 4d61971a08
commit b2edcf60a8

View File

@@ -180,7 +180,13 @@ impl Daemon {
}
fn get_pci_db_online() -> Result<PciDatabase, reqwest::Error> {
let vendors = reqwest::blocking::get("https://pci.endpoint.ml/devices.json")?.json()?;
let client = reqwest::blocking::Client::builder()
.user_agent("LACT")
.build()?;
let vendors = client
.get("https://pci.endpoint.ml/devices.json")
.send()?
.json()?;
Ok(PciDatabase { vendors })
}