Class ResponseTrailersTransform
- Namespace
- Yarp.ReverseProxy.Transforms
- Assembly
- Yarp.ReverseProxy.dll
Transforms for response trailers.
public abstract class ResponseTrailersTransform
- Inheritance
-
ResponseTrailersTransform
- Derived
- Inherited Members
Constructors
ResponseTrailersTransform()
protected ResponseTrailersTransform()
Methods
ApplyAsync(ResponseTrailersTransformContext)
Transforms the given response trailers. The trailers will have (optionally) already been copied to the HttpResponse and any changes should be made there.
public abstract ValueTask ApplyAsync(ResponseTrailersTransformContext context)
Parameters
context
ResponseTrailersTransformContext
Returns
SetHeader(ResponseTrailersTransformContext, string, StringValues)
Sets the given trailer on the HttpResponse.
public static void SetHeader(ResponseTrailersTransformContext context, string headerName, StringValues values)
Parameters
context
ResponseTrailersTransformContextheaderName
stringvalues
StringValues
TakeHeader(ResponseTrailersTransformContext, string)
Removes and returns the current trailer value by first checking the HttpResponse and falling back to the value from HttpResponseMessage only if HeadersCopied is not set. This ordering allows multiple transforms to mutate the same header.
public static StringValues TakeHeader(ResponseTrailersTransformContext context, string headerName)
Parameters
context
ResponseTrailersTransformContextThe transform context.
headerName
stringThe name of the header to take.
Returns
- StringValues
The response header value, or StringValues.Empty if none.