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
contextTransformBuilderContextheaderNamestringvaluestringappendboolconditionResponseCondition
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
contextTransformBuilderContextheaderNamestringconditionResponseCondition
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
contextTransformBuilderContextallowedHeadersstring[]
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
contextTransformBuilderContextheaderNamestringvaluestringappendboolconditionResponseCondition
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
contextTransformBuilderContextheaderNamestringconditionResponseCondition
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
contextTransformBuilderContextallowedHeadersstring[]
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
routeRouteConfigcopybool
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
routeRouteConfigcopybool
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
routeRouteConfigheaderNamestringvaluestringappendboolconditionResponseCondition
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
routeRouteConfigheaderNamestringconditionResponseCondition
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
routeRouteConfigallowedHeadersstring[]
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
routeRouteConfigheaderNamestringvaluestringappendboolconditionResponseCondition
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
routeRouteConfigheaderNamestringconditionResponseCondition
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
routeRouteConfigallowedHeadersstring[]