fix: replace localhost to 127.0.0.1

This commit is contained in:
Polianin Nikita 2024-12-18 07:29:05 +03:00
parent e760ddae0a
commit 74ba4e901a

View File

@ -45,7 +45,7 @@ public static class UrlHelper
public static string GetApiUrl(this HttpContext context, string apiPath = "") public static string GetApiUrl(this HttpContext context, string apiPath = "")
{ {
var scheme = GetCurrentScheme(context); var scheme = GetCurrentScheme(context);
var domain = GetCurrentDomain(context).TrimEnd('/'); var domain = GetCurrentDomain(context).TrimEnd('/').Replace("localhost", "127.0.0.1");
var port = context.Request.Host.Port; var port = context.Request.Host.Port;
var portString = port.HasValue && port != 80 && port != 443 ? $":{port}" : string.Empty; var portString = port.HasValue && port != 80 && port != 443 ? $":{port}" : string.Empty;