Skip to content

Commit 86fe26c

Browse files
authored
fix(proxy): Fix testodrome HTTP header handling in proxy (#11292)
Relates to #22486
1 parent eb6efda commit 86fe26c

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

proxy/src/serverless/mod.rs

+14-1
Original file line numberDiff line numberDiff line change
@@ -437,9 +437,11 @@ async fn request_handler(
437437
let testodrome_id = request
438438
.headers()
439439
.get("X-Neon-Query-ID")
440-
.map(|value| value.to_str().unwrap_or_default().to_string());
440+
.and_then(|value| value.to_str().ok())
441+
.map(|s| s.to_string());
441442

442443
if let Some(query_id) = testodrome_id {
444+
info!(parent: &ctx.span(), "testodrome query ID: {query_id}");
443445
ctx.set_testodrome_id(query_id);
444446
}
445447

@@ -481,6 +483,17 @@ async fn request_handler(
481483
);
482484
let span = ctx.span();
483485

486+
let testodrome_id = request
487+
.headers()
488+
.get("X-Neon-Query-ID")
489+
.and_then(|value| value.to_str().ok())
490+
.map(|s| s.to_string());
491+
492+
if let Some(query_id) = testodrome_id {
493+
info!(parent: &ctx.span(), "testodrome query ID: {query_id}");
494+
ctx.set_testodrome_id(query_id);
495+
}
496+
484497
sql_over_http::handle(config, ctx, request, backend, http_cancellation_token)
485498
.instrument(span)
486499
.await

0 commit comments

Comments
 (0)