fix(proxy): Fix testodrome HTTP header handling in proxy (#11292)

Relates to #22486
This commit is contained in:
Ivan Efremov
2025-03-18 17:14:08 +02:00
committed by GitHub
parent eb6efda98b
commit 86fe26c676

View File

@@ -437,9 +437,11 @@ async fn request_handler(
let testodrome_id = request
.headers()
.get("X-Neon-Query-ID")
.map(|value| value.to_str().unwrap_or_default().to_string());
.and_then(|value| value.to_str().ok())
.map(|s| s.to_string());
if let Some(query_id) = testodrome_id {
info!(parent: &ctx.span(), "testodrome query ID: {query_id}");
ctx.set_testodrome_id(query_id);
}
@@ -481,6 +483,17 @@ async fn request_handler(
);
let span = ctx.span();
let testodrome_id = request
.headers()
.get("X-Neon-Query-ID")
.and_then(|value| value.to_str().ok())
.map(|s| s.to_string());
if let Some(query_id) = testodrome_id {
info!(parent: &ctx.span(), "testodrome query ID: {query_id}");
ctx.set_testodrome_id(query_id);
}
sql_over_http::handle(config, ctx, request, backend, http_cancellation_token)
.instrument(span)
.await