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

Environment variable "CLIENT_IP_HEADER" support Case insensitive #2634

Closed
acmookey opened this issue Mar 27, 2024 · 1 comment
Closed

Environment variable "CLIENT_IP_HEADER" support Case insensitive #2634

acmookey opened this issue Mar 27, 2024 · 1 comment
Labels
bug Something isn't working fixed in dev Fixed in the dev branch

Comments

@acmookey
Copy link

acmookey commented Mar 27, 2024

Describe the feature or enhancement

When the CLIENT_IP_HEADER is set to "X-Real-IP" (in upper case), the setting does not take effect (the effect at this time will still use the request-ip package to obtain the ip from the code point of view). However, when the CLIENT_IP_HEADER is set to "x-real-ip" (all lowercase), the value can be correctly obtained from the HTTP Header X-Real-IP. The document does not mention whether the CLIENT_IP_HEADER value is case sensitive.

The above confusion exists when setting the environment variable "CLIENT_IP_HEADER". Therefore,i'm asking whether the setting value of the environment variable CLIENT_IP_HEADER can be supported to be case-insensitive, or explain in the document description that only all lowercase header values are supported.

ps: The above content is translated from Chinese, please forgive me for any inaccuracies. ☺

@mikecao mikecao added the bug Something isn't working label Mar 28, 2024
@mikecao
Copy link
Collaborator

mikecao commented Mar 28, 2024

You are right. We should convert the header to lowercase before doing the comparison.

@mikecao mikecao added the fixed in dev Fixed in the dev branch label Mar 28, 2024
@mikecao mikecao closed this as completed in a933f5b Apr 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working fixed in dev Fixed in the dev branch
Projects
None yet
Development

No branches or pull requests

2 participants