Delivery API: Ensure the path parameter starts with forward slash (#14428)
* Ensure path starts with forward slash in all cases * Fix path in preview when getting by route * Reintroduce path.length check * Revert previous changes
This commit is contained in:
committed by
GitHub
parent
0f0c256beb
commit
115e79113e
@@ -58,7 +58,8 @@ public class ByRouteContentApiController : ContentApiItemControllerBase
|
||||
path = WebUtility.UrlDecode(path);
|
||||
}
|
||||
|
||||
path = path.EnsureStartsWith("/");
|
||||
path = path.TrimStart("/");
|
||||
path = path.Length == 0 ? "/" : path;
|
||||
|
||||
IPublishedContent? contentItem = GetContent(path);
|
||||
if (contentItem is not null)
|
||||
|
||||
Reference in New Issue
Block a user