Skip to content

Add publisher origin Host header override#748

Open
ChristianPavilonis wants to merge 1 commit into
feature/multi-backend-asset-proxyfrom
host-header-override
Open

Add publisher origin Host header override#748
ChristianPavilonis wants to merge 1 commit into
feature/multi-backend-asset-proxyfrom
host-header-override

Conversation

@ChristianPavilonis
Copy link
Copy Markdown
Collaborator

Summary

  • Adds optional publisher.origin_host_header_override configuration for publisher fallback origin requests.
  • Registers Fastly dynamic backends with the configured Host override while preserving origin_url for connection, SNI, and certificate checks.
  • Documents the TOML/env setting and validates host/host:port values.

Changes

File Change
crates/trusted-server-core/src/settings.rs Adds publisher config field, helper, env/default behavior, and validation tests.
crates/trusted-server-core/src/host_header.rs Adds shared Host header override validation helper and unit tests.
crates/trusted-server-core/src/backend.rs Adds Host header override support and includes override in backend names to avoid dynamic backend collisions.
crates/trusted-server-core/src/publisher.rs Uses the configured override for publisher fallback proxy backend registration and outbound Host.
crates/trusted-server-core/build.rs, crates/trusted-server-core/src/lib.rs Wires the validation helper into build/runtime code.
docs/guide/configuration.md Documents origin_host_header_override and env var usage.
trusted-server.toml Adds a commented example setting.

Closes

N/A

Test plan

  • cargo test --workspace
  • cargo clippy --workspace --all-targets --all-features -- -D warnings
  • cargo fmt --all -- --check
  • JS tests: cd crates/js/lib && npx vitest run
  • JS format: cd crates/js/lib && npm run format
  • Docs format: cd docs && npm run format
  • WASM build: cargo build --package trusted-server-adapter-fastly --release --target wasm32-wasip1
  • Manual testing via fastly compute serve
  • Other: cd docs && npx prettier --check guide/configuration.md

Note: full cd docs && npm run format currently fails on existing base-branch formatting in superpowers/specs/2026-05-28-edgezero-image-optimizer-primitive-design.md; changed docs file passes targeted Prettier check.

Checklist

  • Changes follow CLAUDE.md conventions
  • No unwrap() in production code — use expect("should ...")
  • Uses tracing macros (not println!)
  • New code has tests
  • No secrets or credentials committed

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