Skip to content
Open
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: 9 additions & 0 deletions src/proxy.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,15 @@ pub async fn forward(
.map_err(web::Error::from)?;

let mut client_resp = web::HttpResponse::build(res.status());

// respond without body for /_ping HEAD request
if req.uri().path() == "/_ping" && req.method() == http::Method::HEAD {
for (key, value) in res.headers().iter() {
client_resp.header(key.clone(), value.clone());
}
return Ok(client_resp.finish());
}

client_resp.content_type(res.content_type());

if res.status() == 200 {
Expand Down