KEMBAR78
Optionally log X-Real-IP header. by dctaf · Pull Request #521 · static-web-server/static-web-server · GitHub
Skip to content

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.

@semanticdiff-com
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