StompProtocolAndroid icon indicating copy to clipboard operation
StompProtocolAndroid copied to clipboard

STOMP 1.1 'accept-version' and 'host' CONNECT headers in StompClient class

Open UbivisDev opened this issue 6 years ago • 4 comments

Is there a reason for not implementing the headers 'accept-version' and 'host' as default for the CONNECT frame in StompClient class? Those are required by the protocol as stated here, as the following:

STOMP 1.1 clients MUST set the following headers: accept-version : The versions of the STOMP protocol the client supports. See Protocol Negotiation for more details. host : The name of a virtual host that the client wishes to connect to. It is recommended clients set this to the host name that the socket was established against, or to any name of their choosing. If this header does not match a known virtual host, servers supporting virtual hosting MAY select a default virtual host or reject the connection.

UbivisDev avatar Dec 18 '18 16:12 UbivisDev

you need change the source code: in ua.naiksoftware.stomp.StompHeader class public static final String VERSION = "version"; which should be: public static final String VERSION = "accept-version";

houshunwei avatar Dec 20 '18 06:12 houshunwei

I'm aware of the requirements for it to work. My question is, why is it not standard for the library, as it says it complies with the 1.1 definition? Is there a reason or not? Because if there isn't, I would advocate to include those headers. The 'version' headers isn't even meant to be used by the client as payload in sent messages, it is reserved for the server, unless I'm missing something.

UbivisDev avatar Jan 09 '19 13:01 UbivisDev

Yes, you are right. This is my innatention.

NaikSoftware avatar Jan 09 '19 13:01 NaikSoftware

Stop, StompHeader.VERSION contains "accept-version" string.

NaikSoftware avatar Jan 09 '19 13:01 NaikSoftware