Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/ReverseProxy/Configuration/RouteConfig.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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));
Expand Down
6 changes: 6 additions & 0 deletions test/ReverseProxy.Tests/Configuration/RouteConfigTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ public void Equals_Positive()
Timeout = TimeSpan.FromSeconds(1),
ClusterId = "c",
CorsPolicy = "co",
MaxRequestBodySize = 1024,
Match = new RouteMatch()
{
Headers = new[]
Expand Down Expand Up @@ -52,6 +53,7 @@ public void Equals_Positive()
Timeout = TimeSpan.FromSeconds(1),
ClusterId = "C",
CorsPolicy = "Co",
MaxRequestBodySize = 1024,
Match = new RouteMatch()
{
Headers = new[]
Expand Down Expand Up @@ -94,6 +96,7 @@ public void Equals_Negative()
Timeout = TimeSpan.FromSeconds(1),
ClusterId = "c",
CorsPolicy = "co",
MaxRequestBodySize = 1024,
Match = new RouteMatch()
{
Headers = new[]
Expand Down Expand Up @@ -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));
Expand All @@ -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]
Expand All @@ -155,6 +160,7 @@ public void RouteConfig_CanBeJsonSerialized()
RateLimiterPolicy = "rl",
ClusterId = "c",
CorsPolicy = "co",
MaxRequestBodySize = 1024,
Match = new RouteMatch()
{
Headers = new[]
Expand Down
Loading