Table of Contents

Class ResponseTransformExtensions

Namespace
Yarp.ReverseProxy.Transforms
Assembly
Yarp.ReverseProxy.dll

Extensions for adding response header and trailer transforms.

public static class ResponseTransformExtensions
Inheritance
ResponseTransformExtensions
Inherited Members

Methods

AddResponseHeader(TransformBuilderContext, string, string, bool, ResponseCondition)

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

public static TransformBuilderContext AddResponseHeader(this TransformBuilderContext context, string headerName, string value, bool append = true, ResponseCondition condition = ResponseCondition.Success)

Parameters

context TransformBuilderContext
headerName string
value string
append bool
condition ResponseCondition

Returns

TransformBuilderContext

AddResponseHeaderRemove(TransformBuilderContext, string, ResponseCondition)

Adds the transform which will remove the response header.

public static TransformBuilderContext AddResponseHeaderRemove(this TransformBuilderContext context, string headerName, ResponseCondition condition = ResponseCondition.Success)

Parameters

context TransformBuilderContext
headerName string
condition ResponseCondition

Returns

TransformBuilderContext

AddResponseHeadersAllowed(TransformBuilderContext, params string[])

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

public static TransformBuilderContext AddResponseHeadersAllowed(this TransformBuilderContext context, params string[] allowedHeaders)

Parameters

context TransformBuilderContext
allowedHeaders string[]

Returns

TransformBuilderContext

AddResponseTrailer(TransformBuilderContext, string, string, bool, ResponseCondition)

Adds the transform which will append or set the response trailer.

public static TransformBuilderContext AddResponseTrailer(this TransformBuilderContext context, string headerName, string value, bool append = true, ResponseCondition condition = ResponseCondition.Success)

Parameters

context TransformBuilderContext
headerName string
value string
append bool
condition ResponseCondition

Returns

TransformBuilderContext

AddResponseTrailerRemove(TransformBuilderContext, string, ResponseCondition)

Adds the transform which will remove the response trailer.

public static TransformBuilderContext AddResponseTrailerRemove(this TransformBuilderContext context, string headerName, ResponseCondition condition = ResponseCondition.Success)

Parameters

context TransformBuilderContext
headerName string
condition ResponseCondition

Returns

TransformBuilderContext

AddResponseTrailersAllowed(TransformBuilderContext, params string[])

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

public static TransformBuilderContext AddResponseTrailersAllowed(this TransformBuilderContext context, params string[] allowedHeaders)

Parameters

context TransformBuilderContext
allowedHeaders string[]

Returns

TransformBuilderContext

WithTransformCopyResponseHeaders(RouteConfig, bool)

Clones the route and adds the transform which will enable or suppress copying response headers to the client response.

public static RouteConfig WithTransformCopyResponseHeaders(this RouteConfig route, bool copy = true)

Parameters

route RouteConfig
copy bool

Returns

RouteConfig

WithTransformCopyResponseTrailers(RouteConfig, bool)

Clones the route and adds the transform which will enable or suppress copying response trailers to the client response.

public static RouteConfig WithTransformCopyResponseTrailers(this RouteConfig route, bool copy = true)

Parameters

route RouteConfig
copy bool

Returns

RouteConfig

WithTransformResponseHeader(RouteConfig, string, string, bool, ResponseCondition)

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

public static RouteConfig WithTransformResponseHeader(this RouteConfig route, string headerName, string value, bool append = true, ResponseCondition condition = ResponseCondition.Success)

Parameters

route RouteConfig
headerName string
value string
append bool
condition ResponseCondition

Returns

RouteConfig

WithTransformResponseHeaderRemove(RouteConfig, string, ResponseCondition)

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

public static RouteConfig WithTransformResponseHeaderRemove(this RouteConfig route, string headerName, ResponseCondition condition = ResponseCondition.Success)

Parameters

route RouteConfig
headerName string
condition ResponseCondition

Returns

RouteConfig

WithTransformResponseHeadersAllowed(RouteConfig, params string[])

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

public static RouteConfig WithTransformResponseHeadersAllowed(this RouteConfig route, params string[] allowedHeaders)

Parameters

route RouteConfig
allowedHeaders string[]

Returns

RouteConfig

WithTransformResponseTrailer(RouteConfig, string, string, bool, ResponseCondition)

Clones the route and adds the transform which will append or set the response trailer.

public static RouteConfig WithTransformResponseTrailer(this RouteConfig route, string headerName, string value, bool append = true, ResponseCondition condition = ResponseCondition.Success)

Parameters

route RouteConfig
headerName string
value string
append bool
condition ResponseCondition

Returns

RouteConfig

WithTransformResponseTrailerRemove(RouteConfig, string, ResponseCondition)

Clones the route and adds the transform which will remove the response trailer.

public static RouteConfig WithTransformResponseTrailerRemove(this RouteConfig route, string headerName, ResponseCondition condition = ResponseCondition.Success)

Parameters

route RouteConfig
headerName string
condition ResponseCondition

Returns

RouteConfig

WithTransformResponseTrailersAllowed(RouteConfig, params string[])

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

public static RouteConfig WithTransformResponseTrailersAllowed(this RouteConfig route, params string[] allowedHeaders)

Parameters

route RouteConfig
allowedHeaders string[]

Returns

RouteConfig