-
-
Notifications
You must be signed in to change notification settings - Fork 988
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
Refactor: Improve Code Readability with Constants and Early Returns #842
Conversation
@k-vanio, you have done good job, two points:
|
@lesichkovm Thank you for your feedback! I've addressed the first point by alphabetically sorting the constants. However, regarding the second point about the |
Did not see the new function isValidIP. All is good @k-vanio |
…alidate the integrity of IP addresses within the X-Forwarded-For (XFF) header.
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.
LGTM
LGTM 🚀 |
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.
Refactor: Improve Code Readability with Constants and Early Returns
This commit refactors the
realIP
function by introducing constants for header names(
trueClientIP
,xRealIP
,xForwardedFor
) to enhance code clarity. Additionally, itutilizes the concept of early returns for simplifying the logic and improving overall
readability.
These changes contribute to better maintainability and understanding of the codebase.