From 07a107ca4cad36dd00efb2de12af9703d9762b12 Mon Sep 17 00:00:00 2001 From: Michael Robertson Date: Mon, 24 Jun 2024 11:50:25 -0400 Subject: [PATCH 1/2] Add contextual doc commnets indicating that using Forwarded or XForwarded header transforms will remove the other when enabled. --- src/ReverseProxy/Transforms/ForwardedTransformExtensions.cs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/ReverseProxy/Transforms/ForwardedTransformExtensions.cs b/src/ReverseProxy/Transforms/ForwardedTransformExtensions.cs index 5a856a27b..2fe73eb3e 100644 --- a/src/ReverseProxy/Transforms/ForwardedTransformExtensions.cs +++ b/src/ReverseProxy/Transforms/ForwardedTransformExtensions.cs @@ -113,6 +113,9 @@ public static TransformBuilderContext AddXForwardedPrefix(this TransformBuilderC /// /// Adds the transform which will add X-Forwarded-* request headers. /// + /// + /// Removes the Forwarded header when an X-Forwarded transform is enabled + /// public static TransformBuilderContext AddXForwarded(this TransformBuilderContext context, ForwardedTransformActions action = ForwardedTransformActions.Set) { context.AddXForwardedFor(action: action); @@ -173,6 +176,9 @@ public static RouteConfig WithTransformForwarded(this RouteConfig route, bool us /// /// Adds the transform which will add the Forwarded header as defined by [RFC 7239](https://tools.ietf.org/html/rfc7239). /// + /// + /// Removes the X-Forwarded headers when an Forwarded transform is enabled + /// public static TransformBuilderContext AddForwarded(this TransformBuilderContext context, bool useHost = true, bool useProto = true, NodeFormat forFormat = NodeFormat.Random, NodeFormat byFormat = NodeFormat.Random, ForwardedTransformActions action = ForwardedTransformActions.Set) From c0581beb0a9d8e6a95215a9bce0125249963955f Mon Sep 17 00:00:00 2001 From: Miha Zupan Date: Tue, 2 Jul 2024 16:04:43 +0200 Subject: [PATCH 2/2] Tweak comments --- src/ReverseProxy/Transforms/ForwardedTransformExtensions.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/ReverseProxy/Transforms/ForwardedTransformExtensions.cs b/src/ReverseProxy/Transforms/ForwardedTransformExtensions.cs index 2fe73eb3e..0a0cf9869 100644 --- a/src/ReverseProxy/Transforms/ForwardedTransformExtensions.cs +++ b/src/ReverseProxy/Transforms/ForwardedTransformExtensions.cs @@ -114,7 +114,7 @@ public static TransformBuilderContext AddXForwardedPrefix(this TransformBuilderC /// Adds the transform which will add X-Forwarded-* request headers. /// /// - /// Removes the Forwarded header when an X-Forwarded transform is enabled + /// Also removes the Forwarded header when enabled. /// public static TransformBuilderContext AddXForwarded(this TransformBuilderContext context, ForwardedTransformActions action = ForwardedTransformActions.Set) { @@ -177,7 +177,7 @@ public static RouteConfig WithTransformForwarded(this RouteConfig route, bool us /// Adds the transform which will add the Forwarded header as defined by [RFC 7239](https://tools.ietf.org/html/rfc7239). /// /// - /// Removes the X-Forwarded headers when an Forwarded transform is enabled + /// Also removes the X-Forwarded headers when enabled. /// public static TransformBuilderContext AddForwarded(this TransformBuilderContext context, bool useHost = true, bool useProto = true, NodeFormat forFormat = NodeFormat.Random,