feat(http): log Host/Origin rejections#826
Merged
alexhancock merged 1 commit intomainfrom May 1, 2026
Merged
Conversation
alexhancock
approved these changes
May 1, 2026
Merged
1 task
jrmelsha
added a commit
to UserGeneratedLLC/rmcp-rust-sdk
that referenced
this pull request
May 1, 2026
Brings in upstream rmcp v1.6.0: - fix(http): fall back to :authority for HTTP/2 (modelcontextprotocol#827) - fix: add init_timeout for streamable-http sessions (modelcontextprotocol#811) - feat(http): log Host/Origin rejections (modelcontextprotocol#826) Conflict resolution: - crates/rmcp/CHANGELOG.md: kept fork's bare-boolean Unreleased entry, inserted upstream's 1.6.0 release section beneath it - crates/rmcp/src/transport/streamable_http_server/tower.rs: auto-merged upstream's Host/Origin/HTTP-2 logging additions; kept fork's tracing::debug! for "Resume failed" (ab4ccdb) over upstream's tracing::warn! revert - Cargo.toml workspace bumped to 1.6.0; fork's newer dep versions (pastey 0.2.2, schemars 1.2, reqwest 0.13.3, url 2.5, process-wrap 9.1, chrono 0.4.44) preserved; rand stays removed (ed5868d) since fork doesn't use it - docs.rs anthropic-ext feature retained
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation and Context
The
StreamableHttpServicerejects requests due to Host or Origin validation failures, returning HTTP 400 or 403 responses. However, it doesn't emit atracingevent, which makes log-based alerting for DNS-rebinding attempts impossible. The only signal at the application layer is the HTTP status, but it doesn't include the rejectedHostvalue.This PR adds a
tracing::warn!at each rejection point inparse_host_header,validate_dns_rebinding_headers, andvalidate_origin_header. This way, operators can detect and investigate potential DNS-rebinding or cross-origin attempts. The change is purely additive, meaning it doesn't alter any behavior, status codes, or response bodies.How Has This Been Tested?
The existing integration tests continue to pass.
Breaking Changes
None. Logging-only addition
Types of changes
Checklist