From 5c01e153ccee11644d6c1c34329f7ffc48870308 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 13 May 2026 12:53:32 +0000 Subject: [PATCH 1/2] Initial plan From ff7aa1683eb1069c52dcce0e69787e1e6a5fb657 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 13 May 2026 12:57:20 +0000 Subject: [PATCH 2/2] Include MaxRequestBodySize in route config equality Agent-Logs-Url: https://github.com/dotnet/yarp/sessions/cdd2248e-0899-4e6b-b397-e7b8753feb4d Co-authored-by: MihaZupan <25307628+MihaZupan@users.noreply.github.com> --- src/ReverseProxy/Configuration/RouteConfig.cs | 2 ++ test/ReverseProxy.Tests/Configuration/RouteConfigTests.cs | 6 ++++++ 2 files changed, 8 insertions(+) diff --git a/src/ReverseProxy/Configuration/RouteConfig.cs b/src/ReverseProxy/Configuration/RouteConfig.cs index e8dbd49a8b..9c2b745121 100644 --- a/src/ReverseProxy/Configuration/RouteConfig.cs +++ b/src/ReverseProxy/Configuration/RouteConfig.cs @@ -118,6 +118,7 @@ public bool Equals(RouteConfig? other) && string.Equals(TimeoutPolicy, other.TimeoutPolicy, StringComparison.OrdinalIgnoreCase) && Timeout == other.Timeout && string.Equals(CorsPolicy, other.CorsPolicy, StringComparison.OrdinalIgnoreCase) + && MaxRequestBodySize == other.MaxRequestBodySize && Match == other.Match && CaseSensitiveEqualHelper.Equals(Metadata, other.Metadata) && CaseSensitiveEqualHelper.Equals(Transforms, other.Transforms); @@ -136,6 +137,7 @@ public override int GetHashCode() hash.Add(Timeout?.GetHashCode()); hash.Add(TimeoutPolicy?.GetHashCode(StringComparison.OrdinalIgnoreCase)); hash.Add(CorsPolicy?.GetHashCode(StringComparison.OrdinalIgnoreCase)); + hash.Add(MaxRequestBodySize); hash.Add(Match); hash.Add(CaseSensitiveEqualHelper.GetHashCode(Metadata)); hash.Add(CaseSensitiveEqualHelper.GetHashCode(Transforms)); diff --git a/test/ReverseProxy.Tests/Configuration/RouteConfigTests.cs b/test/ReverseProxy.Tests/Configuration/RouteConfigTests.cs index ebb0647caa..489f144f3e 100644 --- a/test/ReverseProxy.Tests/Configuration/RouteConfigTests.cs +++ b/test/ReverseProxy.Tests/Configuration/RouteConfigTests.cs @@ -21,6 +21,7 @@ public void Equals_Positive() Timeout = TimeSpan.FromSeconds(1), ClusterId = "c", CorsPolicy = "co", + MaxRequestBodySize = 1024, Match = new RouteMatch() { Headers = new[] @@ -52,6 +53,7 @@ public void Equals_Positive() Timeout = TimeSpan.FromSeconds(1), ClusterId = "C", CorsPolicy = "Co", + MaxRequestBodySize = 1024, Match = new RouteMatch() { Headers = new[] @@ -94,6 +96,7 @@ public void Equals_Negative() Timeout = TimeSpan.FromSeconds(1), ClusterId = "c", CorsPolicy = "co", + MaxRequestBodySize = 1024, Match = new RouteMatch() { Headers = new[] @@ -127,6 +130,7 @@ public void Equals_Negative() var i = a with { RateLimiterPolicy = "i" }; var j = a with { TimeoutPolicy = "j" }; var k = a with { Timeout = TimeSpan.FromSeconds(107) }; + var l = a with { MaxRequestBodySize = 2048 }; Assert.False(a.Equals(b)); Assert.False(a.Equals(c)); @@ -138,6 +142,7 @@ public void Equals_Negative() Assert.False(a.Equals(i)); Assert.False(a.Equals(j)); Assert.False(a.Equals(k)); + Assert.False(a.Equals(l)); } [Fact] @@ -155,6 +160,7 @@ public void RouteConfig_CanBeJsonSerialized() RateLimiterPolicy = "rl", ClusterId = "c", CorsPolicy = "co", + MaxRequestBodySize = 1024, Match = new RouteMatch() { Headers = new[]