set BaseAddress for IHttpClientFactory

This commit is contained in:
sbwalker 2024-08-20 15:22:27 -04:00
parent aee0c27da7
commit 085cae3b5f

View File

@ -35,6 +35,7 @@ namespace Oqtane.Services
if (_factory != null)
{
var client = _factory.CreateClient("oqtane");
client.BaseAddress = new Uri(_siteState.Alias.Protocol + _siteState.Alias.Name);
if (!client.DefaultRequestHeaders.Contains(Constants.AntiForgeryTokenHeaderName) && _siteState != null && !string.IsNullOrEmpty(_siteState.AntiForgeryToken))
{
client.DefaultRequestHeaders.Add(Constants.AntiForgeryTokenHeaderName, _siteState.AntiForgeryToken);