Skip to content

Commit

Permalink
forwarded headers configuration updated (#129)
Browse files Browse the repository at this point in the history
  • Loading branch information
vitalyal authored Apr 14, 2023
1 parent 9b6f2f9 commit d1bbd8c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,12 @@ services:
}
]
CLIENTS_CONFIGURATION_PATH: /tmp/config/clients-config.json
ASPNET_SERVICES_OPTIONS_INLINE: |
{
"ForwardedHeadersOptions": {
"ForwardedHeaders" : "All"
}
}
volumes:
- .:/tmp/config:ro
```
Expand Down
2 changes: 2 additions & 0 deletions src/Helpers/AspNetServicesHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@ public static void UseAspNetServices(IApplicationBuilder app, AspNetServicesOpti

if (config.ForwardedHeadersOptions != null)
{
config.ForwardedHeadersOptions.KnownNetworks.Clear();
config.ForwardedHeadersOptions.KnownProxies.Clear();
app.UseForwardedHeaders(config.ForwardedHeadersOptions);
}
}
Expand Down

0 comments on commit d1bbd8c

Please sign in to comment.