Skip to content
Docs Try Aspire

YarpRoute

Handle TypeScript
📦 Aspire.Hosting.Yarp v13.2.0-preview.1.26159.1
interface YarpRoute {
withTransformClientCertHeader(headerName: string): YarpRoute;
withTransformCopyRequestHeaders(copy?: boolean): YarpRoute;
withTransformCopyResponseHeaders(copy?: boolean): YarpRoute;
withTransformCopyResponseTrailers(copy?: boolean): YarpRoute;
withTransformForwarded(
useHost?: boolean,
useProto?: boolean,
forFormat?: NodeFormat,
byFormat?: NodeFormat,
action?: ForwardedTransformActions): YarpRoute;
withTransformHttpMethodChange(
fromHttpMethod: string,
toHttpMethod: string): YarpRoute;
withTransformQueryRemoveKey(queryKey: string): YarpRoute;
withTransformQueryRouteValue(
queryKey: string,
routeValueKey: string,
append?: boolean): YarpRoute;
withTransformQueryValue(
queryKey: string,
value: string,
append?: boolean): YarpRoute;
withTransformRequestHeader(
headerName: string,
value: string,
append?: boolean): YarpRoute;
withTransformRequestHeaderRemove(headerName: string): YarpRoute;
withTransformRequestHeaderRouteValue(
headerName: string,
routeValueKey: string,
append?: boolean): YarpRoute;
withTransformRequestHeadersAllowed(allowedHeaders: string[]): YarpRoute;
withTransformResponseHeader(
headerName: string,
value: string,
append?: boolean,
condition?: ResponseCondition): YarpRoute;
withTransformResponseHeaderRemove(
headerName: string,
condition?: ResponseCondition): YarpRoute;
withTransformResponseHeadersAllowed(allowedHeaders: string[]): YarpRoute;
withTransformResponseTrailer(
headerName: string,
value: string,
append?: boolean,
condition?: ResponseCondition): YarpRoute;
withTransformResponseTrailerRemove(
headerName: string,
condition?: ResponseCondition): YarpRoute;
withTransformResponseTrailersAllowed(allowedHeaders: string[]): YarpRoute;
withTransformUseOriginalHostHeader(useOriginal?: boolean): YarpRoute;
withTransformXForwarded(
headerPrefix?: string,
xDefault?: ForwardedTransformActions,
xFor?: ForwardedTransformActions,
xHost?: ForwardedTransformActions,
xProto?: ForwardedTransformActions,
xPrefix?: ForwardedTransformActions): YarpRoute;
}

Methods

method withTransformClientCertHeader
Adds the transform which will set the given header with the Base64 encoded client certificate.
withTransformClientCertHeader(headerName: string): YarpRoute
headerName string
YarpRoute
method withTransformCopyRequestHeaders
Adds the transform which will enable or suppress copying request headers to the proxy request.
withTransformCopyRequestHeaders(copy?: boolean): YarpRoute
copy boolean optional = True
YarpRoute
method withTransformCopyResponseHeaders
Adds the transform which will enable or suppress copying response headers to the client response.
withTransformCopyResponseHeaders(copy?: boolean): YarpRoute
copy boolean optional = True
YarpRoute
method withTransformCopyResponseTrailers
Adds the transform which will enable or suppress copying response trailers to the client response.
withTransformCopyResponseTrailers(copy?: boolean): YarpRoute
copy boolean optional = True
YarpRoute
method withTransformForwarded
Adds the transform which will add the Forwarded header as defined by [RFC 7239](https://tools.ietf.org/html/rfc7239).
withTransformForwarded(
useHost?: boolean,
useProto?: boolean,
forFormat?: NodeFormat,
byFormat?: NodeFormat,
action?: ForwardedTransformActions): YarpRoute
useHost boolean optional = True
useProto boolean optional = True
forFormat NodeFormat optional = Random
byFormat NodeFormat optional = Random
action ForwardedTransformActions optional = Set
YarpRoute
method withTransformHttpMethodChange
Adds the transform that will replace the HTTP method if it matches.
withTransformHttpMethodChange(
fromHttpMethod: string,
toHttpMethod: string): YarpRoute
fromHttpMethod string
toHttpMethod string
YarpRoute
method withTransformQueryRemoveKey
Adds the transform that will remove the given query key.
withTransformQueryRemoveKey(queryKey: string): YarpRoute
queryKey string
YarpRoute
method withTransformQueryRouteValue
Adds the transform that will append or set the query parameter from a route value.
withTransformQueryRouteValue(
queryKey: string,
routeValueKey: string,
append?: boolean): YarpRoute
queryKey string
routeValueKey string
append boolean optional = True
YarpRoute
method withTransformQueryValue
Adds the transform that will append or set the query parameter from the given value.
withTransformQueryValue(
queryKey: string,
value: string,
append?: boolean): YarpRoute
queryKey string
value string
append boolean optional = True
YarpRoute
method withTransformRequestHeader
Adds the transform which will append or set the request header.
withTransformRequestHeader(
headerName: string,
value: string,
append?: boolean): YarpRoute
headerName string
value string
append boolean optional = True
YarpRoute
method withTransformRequestHeaderRemove
Adds the transform which will remove the request header.
withTransformRequestHeaderRemove(headerName: string): YarpRoute
headerName string
YarpRoute
method withTransformRequestHeaderRouteValue
Adds the transform which will append or set the request header from a route value.
withTransformRequestHeaderRouteValue(
headerName: string,
routeValueKey: string,
append?: boolean): YarpRoute
headerName string
routeValueKey string
append boolean optional = True
YarpRoute
method withTransformRequestHeadersAllowed
Adds the transform which will only copy the allowed request headers. Other transforms
withTransformRequestHeadersAllowed(allowedHeaders: string[]): YarpRoute
allowedHeaders string[]
YarpRoute
method withTransformResponseHeader
Adds the transform which will append or set the response header.
withTransformResponseHeader(
headerName: string,
value: string,
append?: boolean,
condition?: ResponseCondition): YarpRoute
headerName string
value string
append boolean optional = True
condition ResponseCondition optional = Success
YarpRoute
method withTransformResponseHeaderRemove
Adds the transform which will remove the response header.
withTransformResponseHeaderRemove(
headerName: string,
condition?: ResponseCondition): YarpRoute
headerName string
condition ResponseCondition optional = Success
YarpRoute
method withTransformResponseHeadersAllowed
Adds the transform which will only copy the allowed response headers. Other transforms
withTransformResponseHeadersAllowed(allowedHeaders: string[]): YarpRoute
allowedHeaders string[]
YarpRoute
method withTransformResponseTrailer
Adds the transform which will append or set the response trailer.
withTransformResponseTrailer(
headerName: string,
value: string,
append?: boolean,
condition?: ResponseCondition): YarpRoute
headerName string
value string
append boolean optional = True
condition ResponseCondition optional = Success
YarpRoute
method withTransformResponseTrailerRemove
Adds the transform which will remove the response trailer.
withTransformResponseTrailerRemove(
headerName: string,
condition?: ResponseCondition): YarpRoute
headerName string
condition ResponseCondition optional = Success
YarpRoute
method withTransformResponseTrailersAllowed
Adds the transform which will only copy the allowed response trailers. Other transforms
withTransformResponseTrailersAllowed(allowedHeaders: string[]): YarpRoute
allowedHeaders string[]
YarpRoute
method withTransformUseOriginalHostHeader
Adds the transform which will copy the incoming request Host header to the proxy request.
withTransformUseOriginalHostHeader(useOriginal?: boolean): YarpRoute
useOriginal boolean optional = True
YarpRoute
method withTransformXForwarded
Adds the transform which will add X-Forwarded-* headers.
withTransformXForwarded(
headerPrefix?: string,
xDefault?: ForwardedTransformActions,
xFor?: ForwardedTransformActions,
xHost?: ForwardedTransformActions,
xProto?: ForwardedTransformActions,
xPrefix?: ForwardedTransformActions): YarpRoute
headerPrefix string optional = X-Forwarded-
xDefault ForwardedTransformActions optional = Set
xFor ForwardedTransformActions optional
xHost ForwardedTransformActions optional
xProto ForwardedTransformActions optional
xPrefix ForwardedTransformActions optional
YarpRoute