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

Additional HTTP methods #15

Merged
merged 2 commits into from
Nov 27, 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
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