Skip to content

Set host header consistently in STOMP relay CONNECT frames#36673

Closed
tianhaocui wants to merge 1 commit into
spring-projects:mainfrom
tianhaocui:fix-stomp-relay-host-header
Closed

Set host header consistently in STOMP relay CONNECT frames#36673
tianhaocui wants to merge 1 commit into
spring-projects:mainfrom
tianhaocui:fix-stomp-relay-host-header

Conversation

@tianhaocui
Copy link
Copy Markdown
Contributor

Closes #36663

StompBrokerRelayMessageHandler only set the host header in CONNECT frames when virtualHost was explicitly configured. Per STOMP 1.2 specification, the host header is required on CONNECT frames.

This change falls back to relayHost (the TCP connection target) when virtualHost is not configured, ensuring the host header is always present in both system session and client session CONNECT frames.

StompBrokerRelayMessageHandler only set the host header in CONNECT
frames when virtualHost was explicitly configured. Per STOMP 1.2, the
host header is required on CONNECT frames.

Fall back to relayHost (the TCP connection target) when virtualHost is
not configured, ensuring the host header is always present in both
system session and client session CONNECT frames.

Closes spring-projects#36663

Signed-off-by: cuitianhao <54015884+tianhaocui@users.noreply.github.com>
@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged or decided on label Apr 19, 2026
@rstoyanchev rstoyanchev self-assigned this Apr 28, 2026
@rstoyanchev rstoyanchev added in: web Issues in web modules (web, webmvc, webflux, websocket) type: enhancement A general enhancement and removed status: waiting-for-triage An issue we've not yet triaged or decided on labels Apr 28, 2026
@rstoyanchev rstoyanchev added this to the 7.0.8 milestone Apr 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

in: web Issues in web modules (web, webmvc, webflux, websocket) type: enhancement A general enhancement

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Consistently set host header in StompRelayMessageBrokerHandler

3 participants