Class ResponseTransformExtensions
Extensions for adding response header and trailer transforms.
Inheritance
System.Object
ResponseTransformExtensions
Assembly: Yarp.ReverseProxy.dll
public static class ResponseTransformExtensions : object
Methods
|
Improve this Doc
View Source
Adds the transform which will append or set the response header.
Declaration
public static TransformBuilderContext AddResponseHeader(this TransformBuilderContext context, string headerName, string value, bool append = true, ResponseCondition condition = ResponseCondition.Success)
Parameters
Returns
|
Improve this Doc
View Source
Adds the transform which will remove the response header.
Declaration
public static TransformBuilderContext AddResponseHeaderRemove(this TransformBuilderContext context, string headerName, ResponseCondition condition = ResponseCondition.Success)
Parameters
Returns
|
Improve this Doc
View Source
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.
Declaration
public static TransformBuilderContext AddResponseHeadersAllowed(this TransformBuilderContext context, params string[] allowedHeaders)
Parameters
Returns
|
Improve this Doc
View Source
AddResponseTrailer(TransformBuilderContext, String, String, Boolean, ResponseCondition)
Adds the transform which will append or set the response trailer.
Declaration
public static TransformBuilderContext AddResponseTrailer(this TransformBuilderContext context, string headerName, string value, bool append = true, ResponseCondition condition = ResponseCondition.Success)
Parameters
Returns
|
Improve this Doc
View Source
AddResponseTrailerRemove(TransformBuilderContext, String, ResponseCondition)
Adds the transform which will remove the response trailer.
Declaration
public static TransformBuilderContext AddResponseTrailerRemove(this TransformBuilderContext context, string headerName, ResponseCondition condition = ResponseCondition.Success)
Parameters
Returns
|
Improve this Doc
View Source
AddResponseTrailersAllowed(TransformBuilderContext, 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.
Declaration
public static TransformBuilderContext AddResponseTrailersAllowed(this TransformBuilderContext context, params string[] allowedHeaders)
Parameters
Returns
|
Improve this Doc
View Source
Clones the route and adds the transform which will enable or suppress copying response headers to the client response.
Declaration
public static RouteConfig WithTransformCopyResponseHeaders(this RouteConfig route, bool copy = true)
Parameters
Type |
Name |
Description |
RouteConfig |
route |
|
System.Boolean |
copy |
|
Returns
|
Improve this Doc
View Source
Clones the route and adds the transform which will enable or suppress copying response trailers to the client response.
Declaration
public static RouteConfig WithTransformCopyResponseTrailers(this RouteConfig route, bool copy = true)
Parameters
Type |
Name |
Description |
RouteConfig |
route |
|
System.Boolean |
copy |
|
Returns
|
Improve this Doc
View Source
Clones the route and adds the transform which will append or set the response header.
Declaration
public static RouteConfig WithTransformResponseHeader(this RouteConfig route, string headerName, string value, bool append = true, ResponseCondition condition = ResponseCondition.Success)
Parameters
Returns
|
Improve this Doc
View Source
Clones the route and adds the transform which will remove the response header.
Declaration
public static RouteConfig WithTransformResponseHeaderRemove(this RouteConfig route, string headerName, ResponseCondition condition = ResponseCondition.Success)
Parameters
Returns
|
Improve this Doc
View Source
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.
Declaration
public static RouteConfig WithTransformResponseHeadersAllowed(this RouteConfig route, params string[] allowedHeaders)
Parameters
Type |
Name |
Description |
RouteConfig |
route |
|
System.String[] |
allowedHeaders |
|
Returns
|
Improve this Doc
View Source
Clones the route and adds the transform which will append or set the response trailer.
Declaration
public static RouteConfig WithTransformResponseTrailer(this RouteConfig route, string headerName, string value, bool append = true, ResponseCondition condition = ResponseCondition.Success)
Parameters
Returns
|
Improve this Doc
View Source
Clones the route and adds the transform which will remove the response trailer.
Declaration
public static RouteConfig WithTransformResponseTrailerRemove(this RouteConfig route, string headerName, ResponseCondition condition = ResponseCondition.Success)
Parameters
Returns
|
Improve this Doc
View Source
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.
Declaration
public static RouteConfig WithTransformResponseTrailersAllowed(this RouteConfig route, params string[] allowedHeaders)
Parameters
Type |
Name |
Description |
RouteConfig |
route |
|
System.String[] |
allowedHeaders |
|
Returns