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

Update Rust crate http to v1 #133

Merged
merged 2 commits into from
Nov 18, 2023
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
33 changes: 22 additions & 11 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 ccc-handlers/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ ccc-proxy = { path = "../ccc-proxy" }
ccc-types = { path = "../ccc-types" }
axum = "0.6.20"
axum-macros = "0.3.8"
http = "0.2.11"
http = "1.0.0"
reqwest = { version = "0.11.22", features = ["json"] }
serde = { version = "1.0.192", features = ["derive"] }
serde_json = "1.0.108"
Expand Down
7 changes: 4 additions & 3 deletions ccc-handlers/src/bonapp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,11 @@ use axum::{
response::{IntoResponse, Response},
Json,
};
use ccc_proxy::ProxyError;
use http::StatusCode;
use reqwest::{Method, StatusCode};
use tracing::instrument;

use ccc_proxy::ProxyError;

#[instrument]
async fn send_proxied_query<T>(
query_type: QueryType,
Expand All @@ -23,7 +24,7 @@ where

let request = ccc_proxy::global_proxy()
.client()
.request(http::Method::GET, base_url)
.request(Method::GET, base_url)
.query(&[(entity, entity_id)])
.build()
.map_err(ProxyError::ProxiedRequest)
Expand Down
3 changes: 2 additions & 1 deletion ccc-handlers/src/github.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
use axum::response::Json;
use reqwest::Method;
use serde::de::DeserializeOwned;

async fn gh_pages_handler<T>(filename: &str) -> Result<Json<T>, ccc_proxy::ProxyError>
Expand All @@ -9,7 +10,7 @@ where

let request = ccc_proxy::global_proxy()
.client()
.request(http::Method::GET, url)
.request(Method::GET, url)
.build()
.map_err(ccc_proxy::ProxyError::ProxiedRequest)?;

Expand Down
2 changes: 1 addition & 1 deletion ccc-proxy/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ publish = false
[dependencies]
axum = "0.6.20"
bytes = "1.5.0"
http = "0.2.11"
http = "1.0.0"
reqwest = { version = "0.11.22", features = ["json"] }
serde = { version = "1.0.192", features = ["derive"] }
serde_json = "1.0.108"
Expand Down
3 changes: 1 addition & 2 deletions ccc-proxy/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@ use std::sync::OnceLock;

use axum::response::{IntoResponse, Response};
use bytes::Bytes;
use http::StatusCode;
use reqwest::{header::HeaderValue, Request};
use reqwest::{header::HeaderValue, Request, StatusCode};
use serde::de::DeserializeOwned;
use tracing::instrument;

Expand Down