RouteConfig Class
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
public sealed class RouteConfig : IEquatable<Yarp.ReverseProxy.Configuration.RouteConfig>
type RouteConfig = class
interface IEquatable<RouteConfig>
Public NotInheritable Class RouteConfig
Implements IEquatable(Of RouteConfig)
- Inheritance
-
RouteConfig
- Implements
Constructors
RouteConfig() |
Properties
AuthorizationPolicy |
The name of the AuthorizationPolicy to apply to this route. If not set then only the FallbackPolicy will apply. Set to "Default" to enable authorization with the applications default policy. Set to "Anonymous" to disable all authorization checks for this route. |
ClusterId |
Gets or sets the cluster that requests matching this route should be proxied to. |
CorsPolicy |
The name of the CorsPolicy to apply to this route. If not set then the route won't be automatically matched for cors preflight requests. Set to "Default" to enable cors with the default policy. Set to "Disable" to refuses cors requests for this route. |
Match |
Parameters used to match requests. This field is required. |
MaxRequestBodySize |
An optional override for how large request bodies can be in bytes. If set, this overrides the server's default (30MB) per request. Set to '-1' to disable the limit for this route. Note that this limit applies only to the YARP forwarder middleware, it does not apply when reading the request body from a custom middleware registered via MapReverseProxy(IEndpointRouteBuilder, Action<IReverseProxyApplicationBuilder>). |
Metadata |
Arbitrary key-value pairs that further describe this route. |
Order |
Optionally, an order value for this route. Routes with lower numbers take precedence over higher numbers. |
OutputCachePolicy |
The name of the OutputCachePolicy to apply to this route. If not set then only the BasePolicy will apply. |
RateLimiterPolicy |
The name of the RateLimiterPolicy to apply to this route. If not set then only the GlobalLimiter will apply. Set to "Disable" to disable rate limiting for this route. Set to "Default" or leave empty to use the global rate limits, if any. |
RouteId |
Globally unique identifier of the route. This field is required. |
Timeout |
The Timeout to apply to this route. This overrides any system defaults. Setting both Timeout and TimeoutPolicy is an error. Timeout granularity is limited to milliseconds. |
TimeoutPolicy |
The name of the TimeoutPolicy to apply to this route. Setting both Timeout and TimeoutPolicy is an error. If not set then only the system default will apply. Set to "Disable" to disable timeouts for this route. Set to "Default" or leave empty to use the system defaults, if any. |
Transforms |
Parameters used to transform the request and response. See ITransformBuilder. |
Methods
<Clone>$() | |
Equals(Object) | |
Equals(RouteConfig) | |
GetHashCode() | |
ToString() |
Operators
Equality(RouteConfig, RouteConfig) | |
Inequality(RouteConfig, RouteConfig) |
Extension Methods
WithTransformClientCertHeader(RouteConfig, String) |
Clones the route and adds the transform which will set the given header with the Base64 encoded client certificate. |
WithTransformForwarded(RouteConfig, Boolean, Boolean, NodeFormat, NodeFormat, ForwardedTransformActions) |
Clones the route and adds the transform which will add the Forwarded header as defined by RFC 7239. |
WithTransformXForwarded(RouteConfig, String, ForwardedTransformActions, Nullable<ForwardedTransformActions>, Nullable<ForwardedTransformActions>, Nullable<ForwardedTransformActions>, Nullable<ForwardedTransformActions>) |
Clones the route and adds the transform which will add X-Forwarded-* headers. |
WithTransformHttpMethodChange(RouteConfig, String, String) |
Clones the route and adds the transform that will replace the HTTP method if it matches. |
WithTransformPathPrefix(RouteConfig, PathString) |
Clones the route and adds the transform which will prefix the request path with the given value. |
WithTransformPathRemovePrefix(RouteConfig, PathString) |
Clones the route and adds the transform which will remove the matching prefix from the request path. |
WithTransformPathRouteValues(RouteConfig, PathString) |
Clones the route and adds the transform which will set the request path with the given value. |
WithTransformPathSet(RouteConfig, PathString) |
Clones the route and adds the transform which sets the request path with the given value. |
WithTransformQueryRemoveKey(RouteConfig, String) |
Clones the route and adds the transform that will remove the given query key. |
WithTransformQueryRouteValue(RouteConfig, String, String, Boolean) |
Clones the route and adds the transform that will append or set the query parameter from a route value. |
WithTransformQueryValue(RouteConfig, String, String, Boolean) |
Clones the route and adds the transform that will append or set the query parameter from the given value. |
WithTransformCopyRequestHeaders(RouteConfig, Boolean) |
Clones the route and adds the transform which will enable or suppress copying request headers to the proxy request. |
WithTransformRequestHeader(RouteConfig, String, String, Boolean) |
Clones the route and adds the transform which will append or set the request header. |
WithTransformRequestHeaderRemove(RouteConfig, String) |
Clones the route and adds the transform which will remove the request header. |
WithTransformRequestHeaderRouteValue(RouteConfig, String, String, Boolean) |
Clones the route and adds the transform which will append or set the request header from a route value. |
WithTransformRequestHeadersAllowed(RouteConfig, String[]) |
Clones the route and adds the transform which will only copy the allowed request headers. Other transforms that modify or append to existing headers may be affected if not included in the allow list. |
WithTransformUseOriginalHostHeader(RouteConfig, Boolean) |
Clones the route and adds the transform which will copy the incoming request Host header to the proxy request. |
WithTransformCopyResponseHeaders(RouteConfig, Boolean) |
Clones the route and adds the transform which will enable or suppress copying response headers to the client response. |
WithTransformCopyResponseTrailers(RouteConfig, Boolean) |
Clones the route and adds the transform which will enable or suppress copying response trailers to the client response. |
WithTransformResponseHeader(RouteConfig, String, String, Boolean, ResponseCondition) |
Clones the route and adds the transform which will append or set the response header. |
WithTransformResponseHeaderRemove(RouteConfig, String, ResponseCondition) |
Clones the route and adds the transform which will remove the response header. |
WithTransformResponseHeadersAllowed(RouteConfig, 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. |
WithTransformResponseTrailer(RouteConfig, String, String, Boolean, ResponseCondition) |
Clones the route and adds the transform which will append or set the response trailer. |
WithTransformResponseTrailerRemove(RouteConfig, String, ResponseCondition) |
Clones the route and adds the transform which will remove the response trailer. |
WithTransformResponseTrailersAllowed(RouteConfig, 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. |
WithTransform(RouteConfig, Action<IDictionary<String,String>>) |
Clones the RouteConfig and adds the transform. |