Skip to content

Commit

Permalink
Forwarded Header Transforms Doc Comments (#2530)
Browse files Browse the repository at this point in the history
* Add contextual doc commnets indicating that using Forwarded or XForwarded header transforms will remove the other when enabled.

* Tweak comments

---------

Co-authored-by: Miha Zupan <[email protected]>
  • Loading branch information
mroberts91 and MihaZupan authored Jul 2, 2024
1 parent 7b6aecb commit 4b0f664
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/ReverseProxy/Transforms/ForwardedTransformExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,9 @@ public static TransformBuilderContext AddXForwardedPrefix(this TransformBuilderC
/// <summary>
/// Adds the transform which will add X-Forwarded-* request headers.
/// </summary>
/// <remarks>
/// Also removes the <c>Forwarded</c> header when enabled.
/// </remarks>
public static TransformBuilderContext AddXForwarded(this TransformBuilderContext context, ForwardedTransformActions action = ForwardedTransformActions.Set)
{
context.AddXForwardedFor(action: action);
Expand Down Expand Up @@ -173,6 +176,9 @@ public static RouteConfig WithTransformForwarded(this RouteConfig route, bool us
/// <summary>
/// Adds the transform which will add the Forwarded header as defined by [RFC 7239](https://tools.ietf.org/html/rfc7239).
/// </summary>
/// <remarks>
/// Also removes the <c>X-Forwarded</c> headers when enabled.
/// </remarks>
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)
Expand Down

0 comments on commit 4b0f664

Please sign in to comment.