8000 docs: say how the web app really passes on X-Forwarded-For by adeelahmad · Pull Request #161 · adeelahmad/lense · GitHub
[go: up one dir, main page]

Skip to content

docs: say how the web app really passes on X-Forwarded-For - #161

Merged
adeelahmad merged 2 commits into
mainfrom
claude/project-thread-qt650x-xff-docs
Oct 5, 2026
Merged

adeelahmad merged 2 commits into
mainfrom
claude/project-thread-qt650x-xff-docs

Conversation

@adeelahmad
Copy link
Copy Markdown
Owner

Requested by Adeel · project thread

Description

Before: docs/configuration.md said the web app passes on X-Forwarded-For "and adds the address it was reached from".

After: the page says what actually happens. lib/api/backend-proxy.ts copies the header through unchanged. When a request has no X-Forwarded-For, Next.js 16 fills in the connecting address itself (node_modules/next/dist/server/base-server.js:612, req.headers['x-forwarded-for'] ??= socket.remoteAddress). So without a reverse proxy, IP groups do see real visitor addresses, unless the visitor sends their own header. The reverse-proxy bullet now names that header as the way a visitor can claim another address.

Motivation and Context

The threat model's surface pass flagged this mismatch. Checking it showed the code is fine for visitors who send no header, and spoofing without a reverse proxy was already documented. That left the docs as the only defect. Making the web app append the real address would change which address IP groups see behind a remote reverse proxy or the Cloudflare tunnel, so this PR leaves that for the maintainer to decide.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change; ! in the title)

Docs only.

Checklist:

  • The title is a Conventional Commit.
  • My code follows the code style of this project (make hooks checks it on commit).
  • I added or updated tests.
  • My change requires documentation updates, and I have updated docs/ accordingly.
  • Users need more than the title to understand it, so I wrote it under ## Unreleased in CHANGELOG.md.

🤖 Generated with Claude Code

https://claude.ai/code/session_01W42z4FbekWr33b6791svQQ


Generated by Claude Code

The configuration page said the web app adds the visitor's address to
X-Forwarded-For. It passes the header on unchanged; Next.js fills in the
connecting address only when a request carries none.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01W42z4FbekWr33b6791svQQ
@adeelahmad adeelahmad self-assigned this Oct 5, 2026
Copy link
Copy Markdown
Owner Author

Local CI: green. The self-hosted runner is down, so I replayed every PR job from .github/workflows (ci.yml, pre-commit.yml, pr-title.yml) with ci/local-ci.sh --pr 161 (#181). It tests the head merged into the latest main, which is what GitHub's pull_request event tests.

Local CI on PR #161 head a3a1f7d merged into main f69d6af, 2026-10-05 07:13 UTC

Job Result Time
FastAPI (embedded SurrealDB) pass 453s
FastAPI (SurrealDB server) pass 211s
Next.js pass 186s
pre-commit pass 70s
PR title pass 0s

Generated by Claude Code

@adeelahmad
adeelahmad merged commit 74af2e7 into main Oct 5, 2026
7 checks passed
@adeelahmad
adeelahmad deleted the claude/project-thread-qt650x-xff-docs branch October 5, 2026 12:44
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.

2 participants

0