Compare commits

..

2 Commits

Author SHA1 Message Date
khwezi f27433a277 Merge pull request 'Added https failsafe' (#90) from cart into main
Reviewed-on: #90
2026-06-15 17:22:44 +02:00
Khwezi Mngoma 4954ead02d Added https failsafe
continuous-integration/drone/pr Build is passing
2026-06-15 17:22:20 +02:00
+8 -1
View File
@@ -18,7 +18,7 @@ if (!app.Environment.IsDevelopment())
}
app.UseForwardedHeaders();
//app.UseHttpsRedirection();
app.UseHttpsRedirection();
app.UseStatusCodePagesWithReExecute("/not-found", createScopeForStatusCodePages: true);
app.UseHealthChecks("/health", new HealthCheckOptions
@@ -27,6 +27,13 @@ app.UseHealthChecks("/health", new HealthCheckOptions
});
app.MapStaticAssets();
app.Use((context, next) =>
{
if (context.Request.Host.Value!.Contains("midrandbooks.co.za", StringComparison.OrdinalIgnoreCase))
context.Request.Scheme = "https";
return next();
});
app.UseCookiePolicy();
app.UseAuthentication();