remove original host header

This commit is contained in:
SpikeHD
2022-05-16 23:46:08 -07:00
parent ba910a084a
commit 76cfec3ac2
3 changed files with 6 additions and 0 deletions

1
src-tauri/Cargo.lock generated
View File

@@ -719,6 +719,7 @@ name = "cultivation"
version = "0.1.0"
dependencies = [
"futures-util",
"http",
"hudsucker",
"lazy_static",
"open",

View File

@@ -38,6 +38,7 @@ open = "2.1.2"
serde_json = "1"
# Dependencies for the HTTP(S) proxy.
http = "0.2"
hudsucker = "0.17.2"
tracing = "0.1.21"
tokio-rustls = "0.23.0"

View File

@@ -6,6 +6,8 @@
use lazy_static::lazy_static;
use std::sync::Mutex;
use http;
use hudsucker::{
async_trait::async_trait,
certificate_authority::RcgenAuthority,
@@ -58,6 +60,8 @@ impl HttpHandler for ProxyHandler {
let uri = format!("https://{}{}", SERVER.lock().unwrap(), uri_path).parse::<Uri>().unwrap();
*request.uri_mut() = uri;
request.headers_mut().remove(http::header::HOST);
}
println!("New request: {}", &request.uri());