Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Optionally log X-Real-IP header. #521

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

Merged
merged 2 commits into from
Feb 2, 2025
Merged

Conversation

dctaf
Copy link
Contributor

@dctaf dctaf commented Feb 2, 2025

Description

Adds a --log-x-real-ip option and documentation to enable logging of the
X-Real-IP header in a manner similar to the logging of the X-Forwarded-For
header (and --log-forwarded-for) header. --trustied-proxies is respected.

Related Issue

#520

Motivation and Context

For various reasons, many infrastructures use X-Real-IP instead of X-Forwarded-For, and it is useful to have the X-Real-IP value logged.

How Has This Been Tested?

Manually.

Copy link

semanticdiff-com bot commented Feb 2, 2025

Review changes with  SemanticDiff

Changed Files
File Status
  src/log_addr.rs  9% smaller
  docs/content/configuration/command-line-arguments.md Unsupported file format
  docs/content/configuration/environment-variables.md Unsupported file format
  docs/content/features/logging.md Unsupported file format
  src/handler.rs  0% smaller
  src/server.rs  0% smaller
  src/settings/cli.rs  0% smaller
  src/settings/file.rs  0% smaller
  src/settings/mod.rs  0% smaller
  src/testing.rs  0% smaller

@joseluisq joseluisq added enhancement New feature or request v2 v2 release labels Feb 2, 2025
Copy link
Collaborator

@joseluisq joseluisq left a comment

Choose a reason for hiding this comment

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

Looks fine to me.
Good that you clarified the X-Forwarded-For too.

Thanks!

@joseluisq joseluisq merged commit 134db39 into static-web-server:master Feb 2, 2025
25 of 34 checks passed
@joseluisq joseluisq added this to the v2.36.0 milestone Feb 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request v2 v2 release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants