diff --git a/linkerd/app/outbound/src/http/logical.rs b/linkerd/app/outbound/src/http/logical.rs index 1d25436827..fd35ced06b 100644 --- a/linkerd/app/outbound/src/http/logical.rs +++ b/linkerd/app/outbound/src/http/logical.rs @@ -68,11 +68,6 @@ enum RouterParams { } // Only applies to requests with profiles. -// -// TODO Add l5d-dst-canonical header to requests. -// -// TODO(ver) move this into the endpoint stack so that we can only -// set this on meshed connections. #[derive(Clone, Debug)] struct CanonicalDstHeader(NameAddr); diff --git a/linkerd/app/outbound/src/http/logical/profile.rs b/linkerd/app/outbound/src/http/logical/profile.rs index 69adde5cd7..45b533e6e0 100644 --- a/linkerd/app/outbound/src/http/logical/profile.rs +++ b/linkerd/app/outbound/src/http/logical/profile.rs @@ -1,6 +1,6 @@ use super::{ super::{concrete, retry}, - Concrete, NoRoute, + CanonicalDstHeader, Concrete, NoRoute, }; use crate::{policy, BackendRef, ParentRef, UNKNOWN_META}; use linkerd_app_core::{ @@ -313,6 +313,18 @@ impl RouteParams { .http_profile_route .to_layer::>(), ) + // Add l5d-dst-canonical header to requests. + // + // TODO(ver) move this into the endpoint stack so that we can + // only set this on meshed connections. + .push( + http::NewHeaderFromTarget::::layer_via( + |rp: &Self| { + let LogicalAddr(addr) = rp.addr.clone(); + CanonicalDstHeader(addr) + }, + ), + ) // Sets the per-route response classifier as a request // extension. .push(classify::NewClassify::layer())