Set host header consistently in STOMP relay CONNECT frames - #36673
tianhaocui wants to merge 1 commit into
Conversation
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>
|
I don't know if this also lead to problem like mine in other cases: Due to this change, the client could not connect to the external broker (RabbitMQ in my case) and responded with error RabbitMQ has a standard virtual host configured with name In order to fix this error I have to set the virtual host in the In my eyes this change is a breaking change and should have been mentioned somewhere. |
|
@twiedow could you create a separate issue, and we will address it. |
|
Not sure if this is relevant, but I just want to ask if this is intentional. After upgrading to version Spring 7, client can't fails to connect to RabbitMQ with CONNECT frame as
Because line above sets Host to NULL, defaults to '/', what is not good, as that user has restricted access to After couple days, I finally find it and I have workaround, but not sure if this is a way to go + don't want to end up with workarounds being in my code forever :-). Help would be appreciated. I couldn't create an issue and this was the only way to get feedback. |
Closes #36663
StompBrokerRelayMessageHandleronly set thehostheader in CONNECT frames whenvirtualHostwas explicitly configured. Per STOMP 1.2 specification, thehostheader is required on CONNECT frames.This change falls back to
relayHost(the TCP connection target) whenvirtualHostis not configured, ensuring thehostheader is always present in both system session and client session CONNECT frames.