JSteunou / webstomp-client

Stomp client over websocket for browsers
Apache License 2.0
299 stars 59 forks source link

Client sends wrong CONNECT headers on reconnect #18

Closed mschipperheyn closed 8 years ago

mschipperheyn commented 8 years ago

I've run into a problem where during a reconnect, headers are included in the CONNECT message that were part of a previous SEND message, specifically the 'destination' header. This leads to problems for me. Not entirely sure yet how it happens

mschipperheyn commented 8 years ago

Looks like this:

    [ReconnectingWebSocket] ws.onopen http://www.project.com.br/msa/ws/websocket/
    index.ios.bundle:81406[ReconnectingWebSocket] resetting reconnection interval
    index.ios.bundle:81406[ReconnectingWebSocket] this.send http://www.project.com.br/msa/ws/websocket/ CONNECT
    Content-Type:application/json
    X-Requested-With:XMLHttpRequest
    X-Source-Header:WS
    accept-version:1.2,1.1,1.0
    heart-beat:10000,10000
    id:sub-0
    destination:/mobile-server/ping
JSteunou commented 8 years ago

Looking at the code I do not think this is possible. headers are parsed from client connect call, and this is a different object from send call.

Maybe it is from your usage. Are you using the same referenced object for your headers?

JSteunou commented 8 years ago

any more input ?

mschipperheyn commented 8 years ago

I resolved this in the meantime. The reason for my problem if I vaguely recall but not coherently enough to put into writing