on-internet
← Community

ASP.NET Core type converter methods not called

Stack Overflow ·

I'm trying to configure ForwardedHeadersOptions which is part of Microsoft.AspNetCore.HttpOverrides. I've added options to my appsettings.json "ForwardedHeadersOptions": { "ForwardedHeaders": 5, "ForwardLimit": 1, "KnownProxies": [ "111.111.111.111" ] }, First two properties (ForwardedHeaders and ForwardLimit) are mapped properly, while KnownProxies is not. It is expected, because the type of KnownProxies is IList<IPAddress>. So, in order to map this property, I've created type converter: public class IPAddressTypeConverter : TypeConverter { public override bool CanConvertFrom(ITypeDescriptorC

Comments

Sign in or sign up to comment and upvote.

No comments yet.