feat: 当ENABLE_RANDOM_CN_IP为true时,除非请求参数randomCNIP显式为false,默认开启randomCNIP#179
feat: 当ENABLE_RANDOM_CN_IP为true时,除非请求参数randomCNIP显式为false,默认开启randomCNIP#179SunsetMkt wants to merge 5 commits into
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
此PR关闭#177 |
There was a problem hiding this comment.
Code Review
This pull request introduces a new feature to enable random Chinese IPs via a global environment variable or a request parameter, updating the configuration examples, documentation, and option parsing logic. Feedback indicates that the current implementation in util/option.js does not align with the "unless explicitly false" logic described in the documentation. Furthermore, a critical issue was identified where the randomCNIP option is not yet utilized within the request handling logic in util/request.js, meaning the feature currently has no effect on network requests.
|
TODO: 保持旧行为,也不应该覆盖realIP |
|
/gemini review |
There was a problem hiding this comment.
Code Review
This pull request introduces a global configuration setting, ENABLE_RANDOM_CN_IP, which allows users to enable random Chinese IP addresses by default across the application. The changes include updates to the environment variable template, documentation in the README, and the logic in util/option.js. A critical logic flaw was identified in the implementation of the randomCNIP option: since query parameters are typically strings, a value of "false" would be treated as truthy in JavaScript, preventing users from explicitly disabling the feature via URL parameters. A code suggestion was provided to correctly handle both string and boolean inputs.
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
|
/gemini review |
There was a problem hiding this comment.
Code Review
This pull request introduces a new environment variable ENABLE_RANDOM_CN_IP to allow defaulting to random Chinese IPs for requests, along with corresponding documentation in the README. A logic issue was identified in util/option.js where the feature would be disabled by any query parameter value other than true when the global setting is enabled; a suggestion was provided to ensure it only disables when explicitly set to false.
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
|
/gemini review |
There was a problem hiding this comment.
Code Review
This pull request introduces a global configuration ENABLE_RANDOM_CN_IP to enable random Chinese IP usage by default, updating the environment template, documentation, and option parsing logic. Feedback indicates that while the flag is correctly parsed, it is not yet implemented in the actual request handling logic in util/request.js, and a readability improvement was suggested for the complex conditional logic in util/option.js.
|
/gemini review |
There was a problem hiding this comment.
Code Review
This pull request introduces a new environment variable, ENABLE_RANDOM_CN_IP, to enable random Chinese IPs by default, including updates to documentation and the option parsing logic in util/option.js. Review feedback suggests simplifying the boolean logic for better readability and points out that the randomCNIP parameter is currently not utilized in the underlying request implementation, which prevents the feature from working as intended.
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
|
@MoeFurina 此PR需要Squash |
No description provided.