15 lines
514 B
C#
15 lines
514 B
C#
using Microsoft.AspNetCore.HttpOverrides;
|
|
|
|
namespace PlotLine.Services;
|
|
|
|
public static class TrustedProxyScheme
|
|
{
|
|
public static IApplicationBuilder UseTrustedProxyScheme(this IApplicationBuilder app) =>
|
|
// Keep the framework's loopback proxy trust and one-hop limit. Do not
|
|
// accept forwarded hosts or broaden trust to arbitrary remote clients.
|
|
app.UseForwardedHeaders(new ForwardedHeadersOptions
|
|
{
|
|
ForwardedHeaders = ForwardedHeaders.XForwardedProto
|
|
});
|
|
}
|