Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for K8S Ingress Header X-Original-Forwarded-For #88

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Ismaaa
Copy link

@Ismaaa Ismaaa commented Jun 13, 2023

Hey there! I've added support for the X-Original-Forwarded-For header, which is used by Kubernetes Ingress.

I've also put together a few tests to make sure everything works as expected:

  • One test checks if we correctly pick the first IP when a list is passed.
  • Another test makes sure we handle an 'unknown' IP gracefully and pick the next valid one.
  • The last test ensures we correctly extract the IP when it comes with a port.

I believe these changes will make IP resolution in Kubernetes Ingress environments even better. Please have a look and let me know what you think.

@patunalu
Copy link

Is this library sill maintained?

@spathon
Copy link

spathon commented Nov 22, 2023

Nice, but shouldn't it be before x-forwarded-for?

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

Successfully merging this pull request may close these issues.

None yet

3 participants