mirror of
https://github.com/DorkSquadRR/DorkNet.git
synced 2026-10-26 15:38:45 -07:00
Fix notification URLs in HTTP deployments
Fixes #19 by making the December server advertise notification and service URLs with the configured deployment scheme.
This commit is contained in:
@@ -70,7 +70,7 @@ public static class MiddlewarePipelineExtensions
|
||||
if (ctx.Request.Host.Host.Equals(domainCfg.Sub("api"), StringComparison.OrdinalIgnoreCase) &&
|
||||
(ctx.Request.Path == "/admin" || ctx.Request.Path.StartsWithSegments("/admin")))
|
||||
{
|
||||
ctx.Response.Redirect($"https://{domainCfg.Sub("admin")}/", permanent: false);
|
||||
ctx.Response.Redirect(domainCfg.Url("admin", "/"), permanent: false);
|
||||
return;
|
||||
}
|
||||
await next();
|
||||
|
||||
@@ -106,7 +106,8 @@ public static class ServiceCollectionExtensions
|
||||
builder.Configuration["Domain:Apex"]
|
||||
?? Environment.GetEnvironmentVariable("DORKNET_DOMAIN")
|
||||
?? "localhost";
|
||||
builder.Services.AddSingleton(new DomainConfig(apex));
|
||||
var scheme = builder.Configuration["Domain:Scheme"] ?? "https";
|
||||
builder.Services.AddSingleton(new DomainConfig(apex, scheme));
|
||||
builder.Services.Configure<Microsoft.AspNetCore.HostFiltering.HostFilteringOptions>(opt =>
|
||||
{
|
||||
opt.AllowedHosts = new[] { apex, $"*.{apex}", "localhost", "127.0.0.1" };
|
||||
|
||||
Reference in New Issue
Block a user