• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

stacklok / toolhive / 21289409352
60%

Build:
DEFAULT BRANCH: main
Ran 23 Jan 2026 02:30PM UTC
Jobs 1
Files 462
Run time 1min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

23 Jan 2026 02:23PM UTC coverage: 59.871% (+0.03%) from 59.84%
21289409352

push

github

web-flow
Add header forward middleware for remote MCP servers (#3423)

* Add header forward middleware for remote MCP servers

Implement middleware that injects configured headers into requests
before they are forwarded to remote MCP servers. This enables
operators to configure headers server-side, removing the burden
from clients.

This commit adds the core middleware; subsequent commits add RunConfig
types, CLI flags, runner wiring, and CRD support.

Key design decisions:
- RestrictedHeaders blocklist prevents misconfiguration of hop-by-hop,
  request smuggling, and identity spoofing headers
- Authorization is allowed with a warning (valid for static tokens)
- Header names are pre-canonicalized at creation time
- Supports both factory pattern (thv run) and direct creation (thv proxy)
- Header values are never logged, only names at DEBUG level

Related: #3316

* Add Forwarded and Http2-Settings to restricted headers

Add two headers to the RestrictedHeaders blocklist per review feedback:

- Forwarded (RFC 7239): The standardized equivalent of X-Forwarded-*
  headers, which are already blocked. Omitting it left an identity
  spoofing gap.

- Http2-Settings (RFC 7540 Section 3.2.1): A hop-by-hop header used
  in HTTP/1.1 to HTTP/2 upgrades. Forwarding it can cause protocol
  confusion and request smuggling. It is the companion to the already
  blocked Upgrade header.

43 of 49 new or added lines in 1 file covered. (87.76%)

2 existing lines in 1 file now uncovered.

37040 of 61866 relevant lines covered (59.87%)

79.89 hits per line

New Missed Lines in Diff

Lines Coverage ∆ File
6
87.76
pkg/transport/middleware/header_forward.go

Uncovered Existing Lines

Lines Coverage ∆ File
2
70.8
-0.73% pkg/runner/config.go
Jobs
ID Job ID Ran Files Coverage
1 21289409352.1 23 Jan 2026 02:30PM UTC 462
59.87
GitHub Action Run
Source Files on build 21289409352
  • Tree
  • List 462
  • Changed 4
  • Source Changed 0
  • Coverage Changed 4
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • Github Actions Build #21289409352
  • a7cde8a8 on github
  • Prev Build on main (#21288691742)
  • Next Build on main (#21290668496)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc