Skip to content

Commit

Permalink
#H5IS
Browse files Browse the repository at this point in the history
The first character should be stripped from the query string. I think this was the result of me testing in a slightly different context where the query string had a leading question mark, but then failed to realize that this wasn't the case here.

(cherry picked from commit 783b5b9)
  • Loading branch information
abjerner committed Jan 17, 2024
1 parent e0b2633 commit 576a3d7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Skybrud.Umbraco.Redirects/Services/RedirectsService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ public void DeleteRedirect(IRedirect redirect) {
// To support query string forwarding, we should only return a redirect that match either of the two criteria listed below:
// - query string forwarding isn't enabled and the query string is an exact match
// - query string forwarding is enabled and the query string is part of the query string of the inbound URI
string query1 = query.Length == 0 ? string.Empty : $"&{query[1..]}&";
string query1 = query.Length == 0 ? string.Empty : $"&{query}&";
RedirectDto? dto = dtos.FirstOrDefault(x => (!x.ForwardQueryString && query == x.QueryString) || (query1.Contains($"&{x.QueryString}&") && x.ForwardQueryString));

// Wrap the DTO
Expand Down

0 comments on commit 576a3d7

Please sign in to comment.