Skip to content

docs: clarify custom trust proxy callback arguments - #7605

Open
Goodfelb wants to merge 1 commit into
expressjs:masterfrom
Goodfelb:docs/trust-proxy-callback-from-master
Open

Goodfelb wants to merge 1 commit into
expressjs:masterfrom
Goodfelb:docs/trust-proxy-callback-from-master

Conversation

@Goodfelb

Copy link
Copy Markdown

Summary

This pull request improves the documentation for custom trust proxy callbacks in Express.js.

Changes

  • Documented the address and index arguments used by custom trust proxy functions.
  • Clarified that the directly connected socket starts at index 0.
  • Explained how returning true or false determines which proxy addresses are trusted.
  • Added a security reminder about trusting only known proxies.

Related Issue

Related to #6541.

Testing

  • Documentation-only change in lib/utils.js.
  • No application functionality was modified.
  • Automated tests have not been run locally.

Additional Context

PR #7387 already adds related tests and documentation for req.ip. This change adds an explanation at the compileTrust implementation instead. Feedback on whether this additional documentation is useful would be appreciated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant