Skip to content

Commit

Permalink
Prevents trying to fetch page if its URL is invalid (eg. "#")
Browse files Browse the repository at this point in the history
  • Loading branch information
skttl committed Feb 10, 2024
1 parent 4d82842 commit de5eade
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/Our.Umbraco.FullTextSearch/Rendering/HttpPageRenderer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,12 @@ public virtual async Task<string> Render(IPublishedContent publishedContent, Pub
{
var publishedPageUrl = publishedContent.Url(mode: UrlMode.Absolute);

if (!Uri.TryCreate(publishedPageUrl, UriKind.Absolute, out var url))
{
_logger.LogInformation("Unable to render page {NodeId}, url returned is invalid ({Url})", publishedContent.Id, publishedPageUrl);
return string.Empty;
}

try
{
// Using a named client to allow for configuration of default headers, cookies and more during service registration
Expand Down

0 comments on commit de5eade

Please sign in to comment.