fix
This commit is contained in:
+2
-15
@@ -395,22 +395,9 @@ public class Program
|
||||
|
||||
private static string GetFrontendHost(HttpContext ctx, ILogger logger)
|
||||
{
|
||||
// get X-Forwarded-Proto when reversed proxy used
|
||||
// internet <-> nginx (https) <-> site(http)
|
||||
var host = $"{ctx.Request.Headers["X-Forwarded-Proto"]}";
|
||||
|
||||
host = host.IsMissing()
|
||||
? ctx.Request.IsHttps ? "https" : "http"
|
||||
: host!;
|
||||
|
||||
host += $"://{ctx.Request.Host.Value}";
|
||||
|
||||
logger.LogCritical($"FR Host: {host}");
|
||||
if (host.Contains(":4300"))
|
||||
{
|
||||
logger.LogCritical(ctx.Request.Path);
|
||||
logger.LogCritical(string.Join('|', ctx.Request.Headers.Select(x => $"{x.Key}={x.Value}")));
|
||||
}
|
||||
var host = $"{ctx.Request.Headers["Referer"]}";
|
||||
host = host.EndsWith("/") ? host.Substring(0, host.Length - 1) : host;
|
||||
|
||||
return host;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user