Skip to content
This repository has been archived by the owner on Jan 4, 2020. It is now read-only.

优化 get_client_ip 函数的adv模式的处理 #434

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

优化 get_client_ip 函数的adv模式的处理 #434

wants to merge 1 commit into from

Conversation

zhangchu
Copy link

  1. 之前的代码在对 HTTP_X_FORWARDED_FOR 内容进行 array_search 和 unset 操作是没有意义的。
  2. 最重要的是,在一些网络架构下,HTTP_X_FORWARDED_FOR 开始部分中会包含一些内网地址,这些地址对于get_client_ip的逻辑是无用的。
  3. 为此增加了两个函数,is_inner_ip和get_first_outerip

1. 之前的代码在对 HTTP_X_FORWARDED_FOR 内容进行 array_search 和 unset 操作是没有意义的。
2. 最重要的是,在一些网络架构下,HTTP_X_FORWARDED_FOR 开始部分中会包含一些内网地址,这些地址对于get_client_ip的逻辑是无用的。
3. 为此增加了两个函数,is_inner_ip和get_first_outerip
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant