Skip to content

Commit 92ea0f6

Browse files
committed
Repro for #1525
1 parent b39e2cc commit 92ea0f6

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

Diff for: src/JsonApiDotNetCore/Serialization/Response/LinkBuilder.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,7 @@ private string GetLinkForPagination(int pageOffset, string? pageSizeValue)
214214
};
215215

216216
UriComponents components = _options.UseRelativeLinks ? UriComponents.PathAndQuery : UriComponents.AbsoluteUri;
217-
return builder.Uri.GetComponents(components, UriFormat.SafeUnescaped);
217+
return builder.Uri.GetComponents(components, UriFormat.UriEscaped);
218218
}
219219

220220
private string GetQueryStringInPaginationLink(int pageOffset, string? pageSizeValue)

Diff for: test/JsonApiDotNetCoreTests/IntegrationTests/QueryStrings/Filtering/FilterOperatorTests.cs

+4
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,10 @@ await _testContext.RunOnDatabaseAsync(async dbContext =>
8585

8686
responseDocument.Data.ManyValue.ShouldHaveCount(1);
8787
responseDocument.Data.ManyValue[0].Attributes.ShouldContainKey("someString").With(value => value.Should().Be(resource.SomeString));
88+
89+
responseDocument.Links.ShouldNotBeNull();
90+
responseDocument.Links.Self.Should().Be("http://localhost/filterableResources?filter=equals(someString,'This%2c+that+%26+more+%2b+some')");
91+
responseDocument.Links.First.Should().Be("http://localhost/filterableResources?filter=equals(someString,%27This,%20that%20%26%20more%20%2B%20some%27)");
8892
}
8993

9094
[Fact]

0 commit comments

Comments
 (0)