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

feat: support config.maxIpsCount #4014

Merged
merged 2 commits into from Oct 28, 2019
Merged

feat: support config.maxIpsCount #4014

merged 2 commits into from Oct 28, 2019

Conversation

dead-horse
Copy link
Member

Checklist
  • npm test passes
  • tests and/or benchmarks are included
  • documentation is changed or added
  • commit message follows commit guidelines
Affected core subsystem(s)
Description of change

* @member {Integer} Config#maxIpsCount
* @default
* @since 2.25.0
*/
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

之前的实现其实有问题,配置替换成和 koa 的一致。

// Compatible with maxProxyCount logic (previous logic is wrong, only for compatibility with legacy logic)
if (!maxIpsCount && this.app.config.maxProxyCount) maxIpsCount = this.app.config.maxProxyCount + 1;

if (maxIpsCount) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

判断 maxIpsCount > 0

@codecov
Copy link

codecov bot commented Oct 28, 2019

Codecov Report

Merging #4014 into master will not change coverage.
The diff coverage is 100%.

Impacted file tree graph

@@          Coverage Diff           @@
##           master   #4014   +/-   ##
======================================
  Coverage     100%    100%           
======================================
  Files          34      34           
  Lines         945     947    +2     
======================================
+ Hits          945     947    +2
Impacted Files Coverage Δ
config/config.default.js 100% <ø> (ø) ⬆️
app/extend/request.js 100% <100%> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 380e7d6...fc8eb24. Read the comment docs.

@dead-horse dead-horse merged commit b3479e8 into master Oct 28, 2019
popomore pushed a commit that referenced this pull request Oct 28, 2019
feat: support config.maxIpsCount (#4014)
@dead-horse dead-horse deleted the max-ips-count branch October 28, 2019 15:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants