Table of Contents

Class RouteConfig

Namespace
Yarp.ReverseProxy.Configuration
Assembly
Yarp.ReverseProxy.dll

Describes a route that matches incoming requests based on the Match criteria and proxies matching requests to the cluster identified by its ClusterId.

public sealed record RouteConfig : IEquatable<RouteConfig>
Inheritance
RouteConfig
Implements
Inherited Members
Extension Methods

Constructors

RouteConfig()

public 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.

public string? AuthorizationPolicy { get; init; }

Property Value

string

ClusterId

Gets or sets the cluster that requests matching this route should be proxied to.

public string? ClusterId { get; init; }

Property Value

string

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.

public string? CorsPolicy { get; init; }

Property Value

string

Match

Parameters used to match requests. This field is required.

public RouteMatch Match { get; init; }

Property Value

RouteMatch

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.

public long? MaxRequestBodySize { get; init; }

Property Value

long?

Metadata

Arbitrary key-value pairs that further describe this route.

public IReadOnlyDictionary<string, string>? Metadata { get; init; }

Property Value

IReadOnlyDictionary<string, string>

Order

Optionally, an order value for this route. Routes with lower numbers take precedence over higher numbers.

public int? Order { get; init; }

Property Value

int?

RouteId

Globally unique identifier of the route. This field is required.

public string RouteId { get; init; }

Property Value

string

Transforms

Parameters used to transform the request and response. See ITransformBuilder.

public IReadOnlyList<IReadOnlyDictionary<string, string>>? Transforms { get; init; }

Property Value

IReadOnlyList<IReadOnlyDictionary<string, string>>

Methods

Equals(object?)

public override bool Equals(object? obj)

Parameters

obj object

Returns

bool

Equals(RouteConfig?)

public bool Equals(RouteConfig? other)

Parameters

other RouteConfig

Returns

bool

GetHashCode()

public override int GetHashCode()

Returns

int

ToString()

public override string ToString()

Returns

string

<Clone>$()

public RouteConfig <Clone>$()

Returns

RouteConfig

Operators

operator ==(RouteConfig?, RouteConfig?)

public static bool operator ==(RouteConfig? left, RouteConfig? right)

Parameters

left RouteConfig
right RouteConfig

Returns

bool

operator !=(RouteConfig?, RouteConfig?)

public static bool operator !=(RouteConfig? left, RouteConfig? right)

Parameters

left RouteConfig
right RouteConfig

Returns

bool