Skip to content

Add X-Forwarded-By header for request identification and loop prevention#7

Merged
cmer merged 1 commit intomainfrom
cmer/forward-user-agent
Mar 10, 2026
Merged

Add X-Forwarded-By header for request identification and loop prevention#7
cmer merged 1 commit intomainfrom
cmer/forward-user-agent

Conversation

@cmer
Copy link
Owner

@cmer cmer commented Mar 10, 2026

Summary

  • Add X-Forwarded-By: LocalHook/<version> header to forwarded requests for identification and traceability
  • Prevent infinite forwarding loops by skipping re-forwarding requests already marked with the LocalHook header
  • Display version number in startup banner and --help output
  • Preserve original User-Agent headers unchanged
  • Bump version to 1.3.0 with comprehensive test coverage

Test plan

  • All 80 existing tests pass
  • New tests verify X-Forwarded-By header is set correctly
  • Loop prevention tests confirm requests with LocalHook header are captured but not re-forwarded
  • Original User-Agent headers are preserved when forwarding

🤖 Generated with Claude Code

When forwarding webhooks, add X-Forwarded-By: LocalHook/<version> header
to identify the request origin. Skip forwarding for incoming requests
whose X-Forwarded-By starts with "LocalHook" to prevent infinite loops.
Also display version number in startup banner and --help output.
Bump to v1.3.0.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@cmer cmer merged commit 9d8af6a into main Mar 10, 2026
3 checks passed
@cmer cmer deleted the cmer/forward-user-agent branch March 10, 2026 15:38
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