Skip to content

Conversation

@dsturm
Copy link
Contributor

@dsturm dsturm commented Aug 14, 2019

As @todeveni mentioned (#124), the X-Forwarded-For HTTP Header could / should be in a comma seperated format. This PR adds support to get the first value of such list.

It also adds a parameter for the pantheon_client_ip filter, which contains the HTTP Header key.

Further the fetched IP value will be validated per filter_var().

@danielbachhuber danielbachhuber self-requested a review August 14, 2019 18:01
Copy link
Contributor

@danielbachhuber danielbachhuber left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the follow-up PR, @dsturm. Can you fix the failing build, and add an assertion in the existing test case for this new scenario?

@dsturm
Copy link
Contributor Author

dsturm commented Aug 17, 2019

Hey @danielbachhuber, I fixed the error and added an assertion.

After adding filter_var to validate against the value from $_SERVER, should there be the preg_replace() on return?

@danielbachhuber
Copy link
Contributor

@dsturm Oops, missed your question before I landed this.

The preg_replace() is validation from a really long time ago. It could be removed.

Also worth noting: I changed the prefix on the filter from pantheon_ to pantheon_sessions_. You'll need to update if you're using it locally.

@dsturm
Copy link
Contributor Author

dsturm commented Aug 19, 2019

Thanks for the info @danielbachhuber

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