Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Javascript (2.2.2) close() submission with different session ID #1665

Closed
dreamershl opened this issue Jul 15, 2014 · 4 comments
Closed

Javascript (2.2.2) close() submission with different session ID #1665

dreamershl opened this issue Jul 15, 2014 · 4 comments
Labels

Comments

@dreamershl
Copy link
Contributor

After successfully connect to server with web socket as the following, when try to disconnect it, the disconnection request will be submitted without the previous session ID in the request header.

Is this expected?

Another issue is the header will be have these 2, which cause the CORS, Cross-origin resource sharing fail.

      Origin:http://127.0.0.1:9000
      Referer:http://127.0.0.1:9000/

WebSocket Disconnection Request:

      Request URL:http://127.0.0.1:8080/comet/stock?X-Atmosphere-Transport=close&X-Atmosphere-tracking-id=9479812a-0612-4777-b8c5-1bb2c5a93ade&_=1405395651533
      Request Method:GET
      Status Code:200 OK
      Request Headersview source
      Accept:*/*
      Accept-Encoding:gzip,deflate,sdch
      Accept-Language:en-US,en;q=0.8,zh-CN;q=0.6,zh;q=0.4,zh-TW;q=0.2
      Connection:keep-alive
      Content-Type:text/plain
      Host:127.0.0.1:8080
      Origin:http://127.0.0.1:9000
      Referer:http://127.0.0.1:9000/
      User-Agent:Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/35.0.1916.153 Safari/537.36

WebSocket Disconnection Response:

         Access-Control-Allow-Credentials:true
         Access-Control-Allow-Origin:http://127.0.0.1:9000
         Access-Control-Allow-Origin:http://127.0.0.1:9000
         Access-Control-Expose-Headers:X-Atmosphere-tracking-id, X-Heartbeat-Server
         Access-Control-Expose-Headers:
         Cache-Control:no-store, no-cache, must-revalidate
         Content-Length:0
         Expires:-1
         Pragma:no-cache
         Server:Jetty(9.2.1.v20140609)
         Set-Cookie:JSESSIONID=13gn3jl28lrm01qhst5cv2h88r;Path=/
         X-Atmosphere-tracking-id:9479812a-0612-4777-b8c5-1bb2c5a93ade

WebSocket Connection Request:

      Request URL:ws://127.0.0.1:8080/comet/stock?X-Atmosphere-tracking-id=0&X-Atmosphere-Framework=2.2.2-javascript&X-Atmosphere-Transport=websocket&X-Atmosphere-TrackMessageSize=true&Content-Type=application/json&X-atmo-protocol=true
       Request Method:GET
       Status Code:101 Switching Protocols
       Cache-Control:no-cache
       Connection:Upgrade
       Cookie:__ngDebug=false; JSESSIONID=t33920jtcnh129agxhlcckmm; auth=success.dt-workshop
       Host:127.0.0.1:8080
       Origin:http://127.0.0.1:9000
       Pragma:no-cache
       Sec-WebSocket-Extensions:permessage-deflate; client_max_window_bits, x-webkit-deflate-frame
       Sec-WebSocket-Key:sl/2IO2NrXZHlzpWddayyA==
       Sec-WebSocket-Version:13
       Upgrade:websocket
       User-Agent:Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/35.0.1916.153 Safari/537.36

WebSocket Connection Response:

       Connection:Upgrade
       Sec-WebSocket-Accept:iqPIt+CyMqWBDxD7vZokOoOr8aA=
       Upgrade:WebSocket
       X-Atmosphere-first-request:true
       X-Atmosphere-tracking-id:9479812a-0612-4777-b8c5-1bb2c5a93ade
@jfarcand
Copy link
Member

I need more information on how you use atmosphere.js...I'm unable to reproduce using the chat sample BTW https://github.com/Atmosphere/atmosphere-samples/tree/master/samples/chat

@jfarcand
Copy link
Member

FYI

T 127.0.0.1:61875 -> 127.0.0.1:8080 [AP]
GET /chat?X-Atmosphere-tracking-id=0&X-Atmosphere-Framework=2.2.3-javascript&X-Atmosphere-Transport=websocket&X-Atmosphere-TrackMessageSize=true&Content-Type=application/json&X-atmo-protocol=true HTTP/1.1.
Upgrade: websocket.
Connection: Upgrade.
Host: 127.0.0.1:8080.
Origin: http://127.0.0.1:8080.
Pragma: no-cache.
Cache-Control: no-cache.
Sec-WebSocket-Key: 35qInNde8cfOA6CGlExMdw==.
Sec-WebSocket-Version: 13.
Sec-WebSocket-Extensions: permessage-deflate; client_max_window_bits, x-webkit-deflate-frame.
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/35.0.1916.153 Safari/537.36.
Cookie: nikio.guid=237bb9af-c76d-49c2-8682-298d81dc8484; __utma=96992031.1482191270.1393867097.1393869046.1393870117.5; __utmz=96992031.1393870117.5.5.utmcsr=google|utmccn=(organic)|utmcmd=organic|utmctr=http://127.0.0.1:8080/prime-showcase/push/index.jsf.
.


T 127.0.0.1:61873 -> 127.0.0.1:8080 [AP]
GET /favicon.ico HTTP/1.1.
Host: 127.0.0.1:8080.
Connection: keep-alive.
Accept: */*.
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/35.0.1916.153 Safari/537.36.
Accept-Encoding: gzip,deflate,sdch.
Accept-Language: en-US,en;q=0.8,de;q=0.6,fr;q=0.4,nl;q=0.2.
Cookie: nikio.guid=237bb9af-c76d-49c2-8682-298d81dc8484; __utma=96992031.1482191270.1393867097.1393869046.1393870117.5; __utmz=96992031.1393870117.5.5.utmcsr=google|utmccn=(organic)|utmcmd=organic|utmctr=http://127.0.0.1:8080/prime-showcase/push/index.jsf.
.


T 127.0.0.1:8080 -> 127.0.0.1:61873 [AP]
HTTP/1.1 404 Not Found.
Content-Type: text/html; charset=ISO-8859-1.
Cache-Control: must-revalidate,no-cache,no-store.
Content-Length: 300.
Server: Jetty(9.1.2.v20140210).
.
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"/>
<title>Error 404 Not Found</title>
</head>
<body><h2>HTTP ERROR 404</h2>
<p>Problem accessing /favicon.ico. Reason:
<pre>    Not Found</pre></p><hr><i><small>Powered by Jetty://</small></i><hr/>

</body>
</html>


T 127.0.0.1:8080 -> 127.0.0.1:61875 [AP]
HTTP/1.1 101 Switching Protocols.
X-Atmosphere-first-request: true.
X-Atmosphere-tracking-id: 4c86325b-e56c-4b9d-95e3-d7ebc537dc17.
Connection: Upgrade.
Sec-WebSocket-Accept: Cy0xMsuG+kpIA4M3HOkAdhnXjhs=.
Upgrade: WebSocket.
.


T 127.0.0.1:8080 -> 127.0.0.1:61875 [AP]
.045|4c86325b-e56c-4b9d-95e3-d7ebc537dc17|10000| |

T 127.0.0.1:61875 -> 127.0.0.1:8080 [AP]
..a.z....w...pC.Xf..X.C..q...gC.Xf..X.

T 127.0.0.1:8080 -> 127.0.0.1:61875 [AP]
.853|{"message":"dsa","author":"dsa","time":1405462311429}

T 127.0.0.1:61875 -> 127.0.0.1:8080 [AP]
...-.....f.E.a...w.L.?.@.`.L.v...w.^.n

T 127.0.0.1:8080 -> 127.0.0.1:61875 [AP]
.853|{"message":"das","author":"dsa","time":1405462311563}

T 127.0.0.1:61875 -> 127.0.0.1:8080 [AP]
........z...t...9...9...~...|...9...9.

T 127.0.0.1:8080 -> 127.0.0.1:61875 [AP]
.853|{"message":"dsa","author":"dsa","time":1405462311746}

T 127.0.0.1:61875 -> 127.0.0.1:8080 [AP]
...~Z..\;...5..Dx...x...?...=..Dx...x.

T 127.0.0.1:8080 -> 127.0.0.1:61875 [AP]
.853|{"message":"das","author":"dsa","time":1405462311913}

T 127.0.0.1:61875 -> 127.0.0.1:8080 [AP]
........r...|...1...1...v...t...1...

T 127.0.0.1:8080 -> 127.0.0.1:61875 [AP]
.651|{"message":"d","author":"dsa","time":1405462312100}

T 127.0.0.1:61875 -> 127.0.0.1:8080 [AP]
...c...A.......Y...............Y.......

T 127.0.0.1:8080 -> 127.0.0.1:61875 [AP]
.954|{"message":"sdsa","author":"dsa","time":1405462312305}

T 127.0.0.1:61875 -> 127.0.0.1:8080 [AP]
..I/..2.`.=Gn.k.#.:N#.kBd.:Nf.k.#.4

T 127.0.0.1:8080 -> 127.0.0.1:61875 [AP]
.550|{"message":"","author":"dsa","time":1405462312482}

T 127.0.0.1:61875 -> 127.0.0.1:8080 [AP]
..q..E
..0...7S..!...iS..6... S..!...8

T 127.0.0.1:8080 -> 127.0.0.1:61875 [AP]
.853|{"message":"das","author":"dsa","time":1405462312658}

T 127.0.0.1:61875 -> 127.0.0.1:8080 [AP]
...TH..

T 127.0.0.1:61875 -> 127.0.0.1:8080 [AP]
..Woc.,M.i#..nuUAx$.A0u..o$..yuUAx>..s9...#..{u.

T 127.0.0.1:8080 -> 127.0.0.1:61875 [AP]
.B63|{"message":"disconnecting","author":"dsa","time":1405462325358}

T 127.0.0.1:61873 -> 127.0.0.1:8080 [AP]
GET /chat?X-Atmosphere-Transport=close&X-Atmosphere-tracking-id=4c86325b-e56c-4b9d-95e3-d7ebc537dc17&_=1405462325358 HTTP/1.1.
Host: 127.0.0.1:8080.
Connection: keep-alive.
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/35.0.1916.153 Safari/537.36.
Content-Type: text/plain.
Accept: */*.
Referer: http://127.0.0.1:8080/.
Accept-Encoding: gzip,deflate,sdch.
Accept-Language: en-US,en;q=0.8,de;q=0.6,fr;q=0.4,nl;q=0.2.
Cookie: nikio.guid=237bb9af-c76d-49c2-8682-298d81dc8484; __utma=96992031.1482191270.1393867097.1393869046.1393870117.5; __utmz=96992031.1393870117.5.5.utmcsr=google|utmccn=(organic)|utmcmd=organic|utmctr=http://127.0.0.1:8080/prime-showcase/push/index.jsf.
.


T 127.0.0.1:8080 -> 127.0.0.1:61875 [AP]
....

T 127.0.0.1:8080 -> 127.0.0.1:61873 [AP]
HTTP/1.1 200 OK.
X-Atmosphere-tracking-id: 4c86325b-e56c-4b9d-95e3-d7ebc537dc17.
Expires: -1.
Cache-Control: no-store, no-cache, must-revalidate.
Pragma: no-cache.
Content-Length: 0.
Server: Jetty(9.1.2.v20140210).

I'm closing as invalid, please let me know if I'm wrong didn't reproduce properly.

@jfarcand
Copy link
Member

BTW, in your stack above , every thing looks as expected :-) The UUID starts with 0 and then becomes 19479812a-0612-4777-b8c5-1bb2c5a93ade`

@jfarcand
Copy link
Member

Fixed by #1669

@jfarcand jfarcand reopened this Jul 17, 2014
@jfarcand jfarcand added 2.2.0 and removed not a bug labels Jul 17, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants