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
Fix origin IP address retrieval #4
Conversation
therefore configurable via the ADYEN_IP_ADDRESS_HTTP_HEADER Django | ||
setting. We fallback on the basic `REMOTE_ADDR`one which is the | ||
standard, unproxied, HTTP one. | ||
""" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This docstring is cool, as you explained why you did that (as you said "we need"). Yet, it does not tell what the function actually did, like "return an IP address from header".
Also, maybe something more concise on the setting available, like "Header's key can be configured by the ADYEN_IP_ADDRESS_HTTP_HEADER setting, and REMOTE_ADDR
is used as default.".
Don't get me wrong: I like your style and tone, but I like when I've just two lines to read to fully know what the function does, instead of a (still well written) full paragraph.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree with you, there should be a one-line summary of what the method actually does.
Adding it.
Dear Creature of the Night, I have implemented thy requested changes. |
Same question. 😄 |
By the great power of the Eternal Shadow, I hereby grant you the LGTM. |
This PR allows one to configure the name of the HTTP header in which the IP address from which a payment originated can be found.
The canonical default of
'REMOTE_ADDR'
is assumed in case there is noADYEN_IP_ADDRESS_HTTP_HEADER
setting specified in the Django project — which should be the case if any component of the HTTP stack transfers this information in another HTTP header (often, but not always'HTTP_X_FORWARDED_FOR'
).