Skip to content

Only Change MaxRequestBodySize ,Route doesn't reload #3026

@eddyyuen

Description

@eddyyuen

Describe the bug

Route only change maxrequestbodysize,Yarp doesn't reload

To Reproduce

Further technical details

RouteModel.cs

  internal bool HasConfigChanged(RouteConfig newConfig, ClusterState? cluster, int? routeRevision)
  {
      return Cluster != cluster || routeRevision != cluster?.Revision || !Config.Equals(newConfig);
  }

RouteConfig.cs

    public bool Equals(RouteConfig? other)
    {
        if (other is null)
        {
            return false;
        }

        return Order == other.Order
            && string.Equals(RouteId, other.RouteId, StringComparison.OrdinalIgnoreCase)
            && string.Equals(ClusterId, other.ClusterId, StringComparison.OrdinalIgnoreCase)
            && string.Equals(AuthorizationPolicy, other.AuthorizationPolicy, StringComparison.OrdinalIgnoreCase)
#if NET7_0_OR_GREATER
            && string.Equals(RateLimiterPolicy, other.RateLimiterPolicy, StringComparison.OrdinalIgnoreCase)
            && string.Equals(OutputCachePolicy, other.OutputCachePolicy, StringComparison.OrdinalIgnoreCase)
#endif
#if NET8_0_OR_GREATER
            && string.Equals(TimeoutPolicy, other.TimeoutPolicy, StringComparison.OrdinalIgnoreCase)
            && Timeout == other.Timeout
#endif
            && string.Equals(CorsPolicy, other.CorsPolicy, StringComparison.OrdinalIgnoreCase)
            && Match == other.Match
            && CaseSensitiveEqualHelper.Equals(Metadata, other.Metadata)
            && CaseSensitiveEqualHelper.Equals(Transforms, other.Transforms);
    }

I think we should add one condition : long.Equals(MaxRequestBodySize, other.MaxRequestBodySize)
So when we change MaxRequestBodySize ,route will reload

Metadata

Metadata

Labels

Type: BugSomething isn't working

Type

No type
No fields configured for issues without a type.

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions