Skip to content

Commit

Permalink
Merge pull request #15 from wjhoward/additional-methods
Browse files Browse the repository at this point in the history
Additional HTTP methods
  • Loading branch information
wjhoward authored Nov 27, 2023
2 parents f77626c + 761d824 commit e2c143b
Show file tree
Hide file tree
Showing 2 changed files with 273 additions and 37 deletions.
9 changes: 6 additions & 3 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ async fn proxy_handler(

// A non internal request, but the host header has not been defined
(_, _, false, false) => {
info!("Host header not defined");
debug!("Host header not defined");
*response.body_mut() = Body::from("Host header not defined");
*response.status_mut() = StatusCode::NOT_FOUND;
}
Expand Down Expand Up @@ -256,7 +256,7 @@ async fn proxy_handler(
}

response = proxy_config.client.make_request(req).await;
info!(
debug!(
"Proxied response from: {} | Status: {}",
uri,
response.status()
Expand Down Expand Up @@ -309,7 +309,10 @@ pub async fn run_server(config_path: String) {
.expect("TLS config error");

let app = Router::new()
.route("/*path", get(proxy_handler))
.route(
"/*path",
get(proxy_handler).post(proxy_handler).put(proxy_handler),
)
.layer(Extension(proxy_config))
.layer(Extension(proxy_state));

Expand Down
Loading

0 comments on commit e2c143b

Please sign in to comment.