1
0
mirror of https://github.com/bitwarden/server.git synced 2025-04-05 21:18:13 -05:00

XForwardedFor on self host

This commit is contained in:
Kyle Spearrin 2018-05-21 21:24:35 -04:00
parent 3aaaac3c5f
commit 658b47b2fc

View File

@ -18,6 +18,7 @@ using IdentityModel;
using IdentityServer4.AccessTokenValidation;
using jsreport.AspNetCore;
using Bit.Core.IdentityServer;
using Microsoft.AspNetCore.HttpOverrides;
namespace Bit.Api
{
@ -173,6 +174,13 @@ namespace Bit.Api
// Rate limiting
app.UseMiddleware<CustomIpRateLimitMiddleware>();
}
else
{
app.UseForwardedHeaders(new ForwardedHeadersOptions
{
ForwardedHeaders = ForwardedHeaders.XForwardedFor | ForwardedHeaders.XForwardedProto
});
}
// Add static files to the request pipeline.
app.UseStaticFiles();