Fix some reqwest-related issues.
Some websites were throwing errors because we didn't
accept gzipped content and/or had a user-agent they
didn't like.
Diff
crawler/Cargo.toml | 2 +-
crawler/src/lib.rs | 11 +++++++++++
2 files changed, 11 insertions(+), 2 deletions(-)
@@ -6,7 +6,7 @@
[dependencies]
select = ""
reqwest = "0.10.1"
reqwest = { version = "0.10.1", features = ["gzip"] }
url = ""
failure = ""
@@ -33,7 +33,16 @@
Self {
url,
filters: Arc::new(Filters::default()),
client: Arc::new(reqwest::Client::builder().build().unwrap()),
client: Arc::new(
reqwest::Client::builder()
.user_agent(concat!(
env!("CARGO_PKG_NAME"),
"/",
env!("CARGO_PKG_VERSION")
))
.build()
.unwrap(),
),
parent: None,
}
}