-
Notifications
You must be signed in to change notification settings - Fork 6
Open
Labels
enhancementNew feature or requestNew feature or request
Description
It's possible that a user of the library may wish to use our X-Forwarded-For and Forwarded handling/parsers, but choose which IP to use in a different way (than "rightmost non-private", "trusted count", etc.). So they would like strategies like:
func NewLeftmostCustomStrategy(headerName string, filter func(ip string) bool) ...
func NewRightmostCustomStrategy(headerName string, filter func(ip string) bool) ...Those would choose the left/rightmost IP for which filter returns true.
I don't want to add this just because someone "might" want them, but if anyone has any solid examples/use cases, please let us know here.
If we do add this, we might want to also export privateAndLocalRanges and/or isPrivateOrLocal. Those are likely to be needed by a custom filter. (Possibly other helpers, like goodIPAddr?)
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request