Show / Hide Table of Contents

Class RequestHeadersTransformExtensions

Extensions for adding request header transforms.

Inheritance
Object
RequestHeadersTransformExtensions
Namespace: Yarp.ReverseProxy.Transforms
Assembly: Yarp.ReverseProxy.dll
Syntax
public static class RequestHeadersTransformExtensions : object

Methods

| Improve this Doc View Source

AddOriginalHost(TransformBuilderContext, Boolean)

Adds the transform which will copy or remove the original host header.

Declaration
public static TransformBuilderContext AddOriginalHost(this TransformBuilderContext context, bool useOriginal = true)
Parameters
Type Name Description
TransformBuilderContext context
Boolean useOriginal
Returns
Type Description
TransformBuilderContext
| Improve this Doc View Source

AddRequestHeader(TransformBuilderContext, String, String, Boolean)

Adds the transform which will append or set the request header.

Declaration
public static TransformBuilderContext AddRequestHeader(this TransformBuilderContext context, string headerName, string value, bool append = true)
Parameters
Type Name Description
TransformBuilderContext context
String headerName
String value
Boolean append
Returns
Type Description
TransformBuilderContext
| Improve this Doc View Source

AddRequestHeaderRemove(TransformBuilderContext, String)

Adds the transform which will remove the request header.

Declaration
public static TransformBuilderContext AddRequestHeaderRemove(this TransformBuilderContext context, string headerName)
Parameters
Type Name Description
TransformBuilderContext context
String headerName
Returns
Type Description
TransformBuilderContext
| Improve this Doc View Source

AddRequestHeadersAllowed(TransformBuilderContext, String[])

Adds the transform which will only copy the allowed request headers. Other transforms that modify or append to existing headers may be affected if not included in the allow list.

Declaration
public static TransformBuilderContext AddRequestHeadersAllowed(this TransformBuilderContext context, params string[] allowedHeaders)
Parameters
Type Name Description
TransformBuilderContext context
String[] allowedHeaders
Returns
Type Description
TransformBuilderContext
| Improve this Doc View Source

WithTransformCopyRequestHeaders(RouteConfig, Boolean)

Clones the route and adds the transform which will enable or suppress copying request headers to the proxy request.

Declaration
public static RouteConfig WithTransformCopyRequestHeaders(this RouteConfig route, bool copy = true)
Parameters
Type Name Description
RouteConfig route
Boolean copy
Returns
Type Description
RouteConfig
| Improve this Doc View Source

WithTransformRequestHeader(RouteConfig, String, String, Boolean)

Clones the route and adds the transform which will append or set the request header.

Declaration
public static RouteConfig WithTransformRequestHeader(this RouteConfig route, string headerName, string value, bool append = true)
Parameters
Type Name Description
RouteConfig route
String headerName
String value
Boolean append
Returns
Type Description
RouteConfig
| Improve this Doc View Source

WithTransformRequestHeaderRemove(RouteConfig, String)

Clones the route and adds the transform which will remove the request header.

Declaration
public static RouteConfig WithTransformRequestHeaderRemove(this RouteConfig route, string headerName)
Parameters
Type Name Description
RouteConfig route
String headerName
Returns
Type Description
RouteConfig
| Improve this Doc View Source

WithTransformRequestHeadersAllowed(RouteConfig, String[])

Clones the route and adds the transform which will only copy the allowed request headers. Other transforms that modify or append to existing headers may be affected if not included in the allow list.

Declaration
public static RouteConfig WithTransformRequestHeadersAllowed(this RouteConfig route, params string[] allowedHeaders)
Parameters
Type Name Description
RouteConfig route
String[] allowedHeaders
Returns
Type Description
RouteConfig
| Improve this Doc View Source

WithTransformUseOriginalHostHeader(RouteConfig, Boolean)

Clones the route and adds the transform which will copy the incoming request Host header to the proxy request.

Declaration
public static RouteConfig WithTransformUseOriginalHostHeader(this RouteConfig route, bool useOriginal = true)
Parameters
Type Name Description
RouteConfig route
Boolean useOriginal
Returns
Type Description
RouteConfig
  • Improve this Doc
  • View Source
In This Article
Back to top Generated by DocFX