Telemetry fixes

This commit is contained in:
Maurus Decimus
2026-04-12 18:52:18 +02:00
parent 1afad4d843
commit 7564f51642
47 changed files with 2070 additions and 344 deletions

View File

@@ -20,4 +20,5 @@ compact_str = "0.9.0"
[features]
test_mode = []
dev_mode = []
enterprise = []

View File

@@ -18,22 +18,31 @@ impl<'x> HttpContext<'x> {
Self { session, req }
}
#[allow(unused_variables)]
pub fn resolve_response_url(&self, server: &Server) -> String {
if self.session.is_tls {
#[cfg(not(feature = "test_mode"))]
#[cfg(not(any(feature = "dev_mode", feature = "test_mode")))]
{
server.core.network.http.url_https.clone()
}
#[cfg(feature = "test_mode")]
#[cfg(any(feature = "dev_mode", feature = "test_mode"))]
{
format!("https://127.0.0.1:{}", self.session.local_port)
}
} else {
format!(
"{}:{}",
server.core.network.http.url_http, self.session.local_port
)
#[cfg(not(any(feature = "dev_mode", feature = "test_mode")))]
{
format!(
"{}:{}",
server.core.network.http.url_http, self.session.local_port
)
}
#[cfg(any(feature = "dev_mode", feature = "test_mode"))]
{
format!("http://127.0.0.1:{}", self.session.local_port)
}
}
}