Table of Contents

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

ValueTask

SetHeader(ResponseTrailersTransformContext, string, StringValues)

Sets the given trailer on the HttpResponse.

public static void SetHeader(ResponseTrailersTransformContext context, string headerName, StringValues values)

Parameters

context ResponseTrailersTransformContext
headerName string
values 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 ResponseTrailersTransformContext

The transform context.

headerName string

The name of the header to take.

Returns

StringValues

The response header value, or StringValues.Empty if none.