fix: add extension method for getting base url that checks for proxy headers

This commit is contained in:
Stevan Freeborn
2024-04-14 16:59:53 -05:00
parent 0103ddc693
commit 532777f523
4 changed files with 17 additions and 8 deletions
+2 -2
View File
@@ -34,7 +34,7 @@
return;
}
BaseUrl = $"{HttpContextAccessor.HttpContext.Request.Scheme}://{HttpContextAccessor.HttpContext.Request.Host}";
BaseUrl = HttpContextAccessor.HttpContext.Request.GetBaseUrl();
OpenGraphUrl = $"{BaseUrl}{HttpContextAccessor.HttpContext.Request.Path}";
}
}
}
+1
View File
@@ -7,5 +7,6 @@
@using Microsoft.AspNetCore.Components.Web.Virtualization
@using Microsoft.JSInterop
@using Blog
@using Blog.Extensions
@using Blog.Components
@using Blog.Components.Utils