Class ForwardedTransformExtensions
- Namespace
- Yarp.ReverseProxy.Transforms
- Assembly
- Yarp.ReverseProxy.dll
Extensions for adding forwarded header transforms.
public static class ForwardedTransformExtensions
- Inheritance
-
ForwardedTransformExtensions
- Inherited Members
Methods
AddClientCertHeader(TransformBuilderContext, string)
Adds the transform which will set the given header with the Base64 encoded client certificate.
public static TransformBuilderContext AddClientCertHeader(this TransformBuilderContext context, string headerName)
Parameters
contextTransformBuilderContextheaderNamestring
Returns
AddForwarded(TransformBuilderContext, bool, bool, NodeFormat, NodeFormat, ForwardedTransformActions)
Adds the transform which will add the Forwarded header as defined by RFC 7239.
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)
Parameters
contextTransformBuilderContextuseHostbooluseProtoboolforFormatNodeFormatbyFormatNodeFormatactionForwardedTransformActions
Returns
AddXForwarded(TransformBuilderContext, ForwardedTransformActions)
Adds the transform which will add X-Forwarded-* request headers.
public static TransformBuilderContext AddXForwarded(this TransformBuilderContext context, ForwardedTransformActions action = ForwardedTransformActions.Set)
Parameters
contextTransformBuilderContextactionForwardedTransformActions
Returns
AddXForwardedFor(TransformBuilderContext, string, ForwardedTransformActions)
Adds the transform which will add X-Forwarded-For request header.
public static TransformBuilderContext AddXForwardedFor(this TransformBuilderContext context, string headerName = "X-Forwarded-For", ForwardedTransformActions action = ForwardedTransformActions.Set)
Parameters
contextTransformBuilderContextheaderNamestringactionForwardedTransformActions
Returns
AddXForwardedHost(TransformBuilderContext, string, ForwardedTransformActions)
Adds the transform which will add X-Forwarded-Host request header.
public static TransformBuilderContext AddXForwardedHost(this TransformBuilderContext context, string headerName = "X-Forwarded-Host", ForwardedTransformActions action = ForwardedTransformActions.Set)
Parameters
contextTransformBuilderContextheaderNamestringactionForwardedTransformActions
Returns
AddXForwardedPrefix(TransformBuilderContext, string, ForwardedTransformActions)
Adds the transform which will add X-Forwarded-Prefix request header.
public static TransformBuilderContext AddXForwardedPrefix(this TransformBuilderContext context, string headerName = "X-Forwarded-Prefix", ForwardedTransformActions action = ForwardedTransformActions.Set)
Parameters
contextTransformBuilderContextheaderNamestringactionForwardedTransformActions
Returns
AddXForwardedProto(TransformBuilderContext, string, ForwardedTransformActions)
Adds the transform which will add X-Forwarded-Proto request header.
public static TransformBuilderContext AddXForwardedProto(this TransformBuilderContext context, string headerName = "X-Forwarded-Proto", ForwardedTransformActions action = ForwardedTransformActions.Set)
Parameters
contextTransformBuilderContextheaderNamestringactionForwardedTransformActions
Returns
WithTransformClientCertHeader(RouteConfig, string)
Clones the route and adds the transform which will set the given header with the Base64 encoded client certificate.
public static RouteConfig WithTransformClientCertHeader(this RouteConfig route, string headerName)
Parameters
routeRouteConfigheaderNamestring
Returns
WithTransformForwarded(RouteConfig, bool, bool, NodeFormat, NodeFormat, ForwardedTransformActions)
Clones the route and adds the transform which will add the Forwarded header as defined by RFC 7239.
public static RouteConfig WithTransformForwarded(this RouteConfig route, bool useHost = true, bool useProto = true, NodeFormat forFormat = NodeFormat.Random, NodeFormat byFormat = NodeFormat.Random, ForwardedTransformActions action = ForwardedTransformActions.Set)
Parameters
routeRouteConfiguseHostbooluseProtoboolforFormatNodeFormatbyFormatNodeFormatactionForwardedTransformActions
Returns
WithTransformXForwarded(RouteConfig, string, ForwardedTransformActions, ForwardedTransformActions?, ForwardedTransformActions?, ForwardedTransformActions?, ForwardedTransformActions?)
Clones the route and adds the transform which will add X-Forwarded-* headers.
public static RouteConfig WithTransformXForwarded(this RouteConfig route, string headerPrefix = "X-Forwarded-", ForwardedTransformActions xDefault = ForwardedTransformActions.Set, ForwardedTransformActions? xFor = null, ForwardedTransformActions? xHost = null, ForwardedTransformActions? xProto = null, ForwardedTransformActions? xPrefix = null)
Parameters
routeRouteConfigheaderPrefixstringxDefaultForwardedTransformActionsxForForwardedTransformActions?xHostForwardedTransformActions?xProtoForwardedTransformActions?xPrefixForwardedTransformActions?