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

Use the rightmost IP from Forwarded header and add $trustedProxiesCount parameter #50

Closed
wants to merge 6 commits into from

Conversation

aiglesiasn
Copy link
Contributor

Hey Rob,

This PR adds some changes to the library:

  1. As the leftmost IPs of the Forwarded header list can be spoofed, we now will take the rightmost IP.
  2. Add a fifth parameter called $trustedProxiesCount which correspond to the number of IPs (from the right of the list) to be ignored as they're considered to be trusted or known.
  3. Update README file with new information.

Let me know what you think and if any improvements can be made.

Thanks!

Trusted proxies count parameter is used to ignore a specific number of IPs on the Forwarded header list, as they're considered trusted or known.

This commit also:
- adds types to some constructor parameters
- updates comments on parameters
As the leftmost IPs on the Forwarded header list can be spoofed, we are now taking the rightmost IPs from the list.

The library now includes a fifth parameter called $trustedProxiesCount, which is used to ignore a certain number of IPs from the Forwarded header list, so trusted or known IPs can be ignored.
Test now take into account to use the rightmost IP from the Forwarded header list and to be able to ignore a number of IPs with the $trustedProxiesCount parameter
- Add information of the $trustedProxiesCount parameter
- Inform that the library now uses the rightmost IP of the Forwarded header list
@akrabat
Copy link
Owner

akrabat commented Dec 19, 2024

Superseded by #51, though this doesn't cover counting the trusted proxies as that was less pressing.

@akrabat akrabat closed this Dec 19, 2024
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.

2 participants