Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

updated reqwest to 0.9; as a result had to change user agent and resp. status #38

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ serde_derive = "1.0"
argparse = "0.2.1"
bincode = "1.0.0"
encoding = "0.2.33"
reqwest = "0.8.5"
reqwest = "0.9"
url = "1.7.0"
pdb = "0.2.0"
base64 = "0.9.1"
Expand Down
8 changes: 5 additions & 3 deletions src/bin/pesymbols.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@ use std::io::prelude::*;
use std::io::Read;
use url::Url;
use reqwest::Client;
use reqwest::header::UserAgent;
//https://docs.rs/reqwest/0.9.0/reqwest/struct.RequestBuilder.html
use reqwest::header::USER_AGENT;

#[allow(dead_code)]
fn download_pdb(
Expand All @@ -51,10 +52,11 @@ fn download_pdb(
println!("{}\n{}", url, user_agent);
let mut response = Client::new()
.get(url)
.header(UserAgent::new(user_agent.clone()))
.header(USER_AGENT, "foo")
.send()
.expect("Failed to send request");
if response.status() == reqwest::StatusCode::Unregistered(200)
//if response.status() == reqwest::StatusCode::Unregistered(200)
if response.status() == reqwest::StatusCode::OK
{
let mut buffer: Vec<u8> = Vec::new();
response.read_to_end(&mut buffer)
Expand Down