remove debugging headers

This commit is contained in:
Bryan Stitt 2023-03-10 09:45:55 -08:00
parent 684c37ef6c
commit b0c5d2b0eb
3 changed files with 0 additions and 34 deletions

@ -158,7 +158,6 @@ pub async fn serve(port: u16, proxy_app: Arc<Web3ProxyApp>) -> anyhow::Result<()
//
.route("/health", get(status::health))
.route("/status", get(status::status))
.route("/status/headers", get(status::status_headers))
//
// User stuff
//

@ -99,15 +99,6 @@ async fn _proxy_web3_rpc(
.expect("W3P-BACKEND-RPCS should always parse"),
);
// TODO: add a header if a backend rpc was used
headers.insert(
"X-W3P-CLIENT-IP",
ip.to_string()
.parse()
.expect("X-CLIENT-IP should always parse"),
);
Ok(response)
}
@ -272,13 +263,6 @@ async fn _proxy_web3_rpc_with_key(
.expect("W3P-BACKEND-RPCS should always parse"),
);
headers.insert(
"X-W3P-CLIENT-IP",
ip.to_string()
.parse()
.expect("X-CLIENT-IP should always parse"),
);
if let Some(rpc_secret_key_id) = rpc_secret_key_id {
headers.insert(
"X-W3P-KEY-ID",

@ -29,23 +29,6 @@ pub async fn health(
}
}
#[debug_handler]
pub async fn status_headers(headers: HeaderMap) -> impl IntoResponse {
let headers: HashMap<String, String> = headers
.into_iter()
.map(|(k, v)| {
(
k.map(|k| k.to_string()).unwrap_or_default(),
format!("{:?}", v),
)
})
.collect();
let body = json!({ "headers": headers });
Json(body)
}
/// Very basic status page.
///
/// TODO: replace this with proper stats and monitoring