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
TransformBuilderContextheaderName
stringvalue
stringappend
boolcondition
ResponseCondition
Returns
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
TransformBuilderContextheaderName
stringcondition
ResponseCondition
Returns
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
TransformBuilderContextallowedHeaders
string[]
Returns
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
TransformBuilderContextheaderName
stringvalue
stringappend
boolcondition
ResponseCondition
Returns
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
TransformBuilderContextheaderName
stringcondition
ResponseCondition
Returns
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
TransformBuilderContextallowedHeaders
string[]
Returns
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
RouteConfigcopy
bool
Returns
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
RouteConfigcopy
bool
Returns
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
RouteConfigheaderName
stringvalue
stringappend
boolcondition
ResponseCondition
Returns
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
RouteConfigheaderName
stringcondition
ResponseCondition
Returns
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
RouteConfigallowedHeaders
string[]
Returns
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
RouteConfigheaderName
stringvalue
stringappend
boolcondition
ResponseCondition
Returns
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
RouteConfigheaderName
stringcondition
ResponseCondition
Returns
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
RouteConfigallowedHeaders
string[]