diff --git a/dns/src/gurt_server.rs b/dns/src/gurt_server.rs index 8c7695a..2860395 100644 --- a/dns/src/gurt_server.rs +++ b/dns/src/gurt_server.rs @@ -338,13 +338,12 @@ async fn get_ca_certificate_content(app_state: &AppState) -> std::result::Result async fn serve_static_file(ctx: &ServerContext) -> Result { let path = ctx.path(); - let host_header = ctx.request.headers().get("host") - .and_then(|h| h.to_str().ok()) + let host_header = ctx.request.header("host") + .map(|s| s.as_str()) .unwrap_or(""); // Debug logging log::info!("Static file request - Path: '{}', Host header: '{}'", path, host_header); - log::info!("All headers: {:?}", ctx.request.headers()); // Extract hostname without port let hostname = host_header.split(':').next().unwrap_or(host_header); diff --git a/dns/src/gurt_server/routes.rs b/dns/src/gurt_server/routes.rs index 3801c94..ce41ddc 100644 --- a/dns/src/gurt_server/routes.rs +++ b/dns/src/gurt_server/routes.rs @@ -21,8 +21,8 @@ fn parse_query_string(query: &str) -> HashMap { } pub(crate) async fn index(ctx: &ServerContext, _app_state: AppState) -> Result { - let host_header = ctx.request.headers().get("host") - .and_then(|h| h.to_str().ok()) + let host_header = ctx.request.header("host") + .map(|s| s.as_str()) .unwrap_or(""); let hostname = host_header.split(':').next().unwrap_or(host_header);