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

Add TLS support for http #39

Merged
merged 17 commits into from
May 30, 2022
Prev Previous commit
Next Next commit
delete some unnecessary code
Signed-off-by: andrewmatilde <[email protected]>
  • Loading branch information
Andrewmatilde committed May 6, 2022
commit 270907a3055430879f120531568c9180cdc46112
17 changes: 0 additions & 17 deletions chaos-tproxy-proxy/src/proxy/http/server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -332,20 +332,3 @@ impl Service<Request<Body>> for HttpService {
Box::pin(self.clone().handle(request))
}
}

#[test]
fn test_req() {
let mut req = http::request::Request::new("hello world");
(*req.headers_mut()).insert("Host", "earth".parse().unwrap());
let mut parts = Uri::default().into_parts();

parts.authority = match req
.headers()
.iter()
.find(|(header_name, _)| **header_name == HOST)
{
None => None,
Some((_, value)) => Some(value.as_bytes().try_into().unwrap()),
};
dbg!(parts.authority);
}