Add configurations and update packages
This commit is contained in:
@@ -0,0 +1,30 @@
|
||||
using GerstITS.System.Configurations;
|
||||
using GerstITS.Web.Api.Builder;
|
||||
using Microsoft.AspNetCore.Builder;
|
||||
using Microsoft.AspNetCore.HttpOverrides;
|
||||
|
||||
namespace GerstITS.Examples.Api.Configurations
|
||||
{
|
||||
internal sealed class WebApiHeadersConfiguration : IHeaderConfiguration, IConfiguration
|
||||
{
|
||||
#region Constructors
|
||||
|
||||
public WebApiHeadersConfiguration(string parentPrefix, Microsoft.Extensions.Configuration.IConfiguration configuration)
|
||||
{
|
||||
var prefix = $"{parentPrefix}:{this.ToConfigurationPrefix()}";
|
||||
|
||||
ForwardedHeaders = new ForwardedHeadersOptions
|
||||
{
|
||||
ForwardedHeaders = configuration.GetFlaggedEnum<ForwardedHeaders>($"{prefix}:{nameof(ForwardedHeadersOptions)}:{nameof(ForwardedHeadersOptions.ForwardedHeaders)}")
|
||||
};
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region IHeaderConfiguration
|
||||
|
||||
public ForwardedHeadersOptions ForwardedHeaders { get; }
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user