Skip to content
This repository has been archived by the owner on Nov 1, 2023. It is now read-only.

Can't do custom ip address parsing Owin #145

Open
marklane23 opened this issue Mar 17, 2021 · 0 comments
Open

Can't do custom ip address parsing Owin #145

marklane23 opened this issue Mar 17, 2021 · 0 comments

Comments

@marklane23
Copy link

marklane23 commented Mar 17, 2021

Setting a new CustomIpAddressParser() for Owin setup doesn't actually call the custom parser.

The bug exists in ThrottlingMiddleware, SetIdentity. this is missing a call to core.IpAddressParser.

Inside ThrottlingHandler, SetIdentity we see:
entry.ClientIp = core.GetClientIp(request).ToString();

but in ThrottlingMiddleware we see:
entry.ClientIp = request.RemoteIpAddress;

in order for this to work we need to setup a method or call to IpAddressParser so the overloaded method can be reached, like:
entry.ClientIp = core.GetOwinClientIp(request);

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant