Fix logging of User-Agent header in reqwest-tracing (#148)

This commit is contained in:
Luca Palmieri 2024-04-26 14:54:35 +02:00 committed by GitHub
parent 1954b5c94f
commit 9ac5f691bf
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -125,7 +125,7 @@ macro_rules! reqwest_otel_span {
let host_port = url.port_or_known_default().unwrap_or(0) as i64; let host_port = url.port_or_known_default().unwrap_or(0) as i64;
let otel_name = $name.to_string(); let otel_name = $name.to_string();
let header_default = &::http::HeaderValue::from_static(""); let header_default = &::http::HeaderValue::from_static("");
let user_agent = format!("{:?}", $request.headers().get("user_agent").unwrap_or(header_default)).replace('"', ""); let user_agent = format!("{:?}", $request.headers().get("user-agent").unwrap_or(header_default)).replace('"', "");
macro_rules! request_span { macro_rules! request_span {
($lvl:expr) => { ($lvl:expr) => {