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

Upgrade reqwest to 0.12 #2015

Merged
merged 2 commits into from
Jun 3, 2024
Merged
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
149 changes: 119 additions & 30 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion proxy/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ qubesdb = []
[dependencies]
anyhow = {version = "1.0.75"}
futures-util = "0.3.30"
reqwest = {version = "0.11.20", features = ["gzip", "stream"]}
reqwest = { version = "0.12", features = ["gzip", "stream"] }
serde = {version = "1.0.188", features = ["derive"]}
serde_json = "1.0.107"
tokio = {version = "1.0", features = ["macros", "rt"]}
Expand Down
8 changes: 5 additions & 3 deletions proxy/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -165,10 +165,12 @@ async fn main() -> ExitCode {
match proxy().await {
Ok(()) => ExitCode::SUCCESS,
Err(err) => {
let mut error = err.to_string();
if let Some(source) = err.source() {
error = format!("{}: {}", error, source);
}
// Try to serialize into our error format
let resp = ErrorResponse {
error: err.to_string(),
};
let resp = ErrorResponse { error };
match serde_json::to_string(&resp) {
Ok(json) => {
// Print the error to stderr
Expand Down
3 changes: 1 addition & 2 deletions proxy/tests/test_errors.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,5 @@ def test_cannot_connect(proxy_request):
assert (
result.stderr.decode().strip()
== '{"error":"error sending request for url (http://missing.test/): '
+ "error trying to connect: dns error: failed to lookup address information: "
+ 'Name or service not known"}'
+ 'client error (Connect)"}'
)
Loading