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

onHeaders is not always invoked #12

Open
mrkam opened this issue Nov 29, 2016 · 4 comments
Open

onHeaders is not always invoked #12

mrkam opened this issue Nov 29, 2016 · 4 comments

Comments

@mrkam
Copy link

mrkam commented Nov 29, 2016

I've noticed that onHeaders callback is most often not invoked. in Google Chrome Version 54.0.2840.99 m (64-bit)

@mrkam
Copy link
Author

mrkam commented Nov 29, 2016

Probably because the source don't send any data upon connection (headers only). Seems like only when a message is sent onHeaders is invoked.

@senthilp
Copy link
Contributor

@yaslama Can you comment on this?

@mrkam
Copy link
Author

mrkam commented Nov 29, 2016

Looks like the issue is on the browser side. I've tried to use plain XMLHttpRequest and added all possible event listeners. None was invoked after changing the readyState to OPEN although Network tab in Developer Tools does show received response headers for the request.

@mrkam
Copy link
Author

mrkam commented Nov 29, 2016

Here is how the response looks with curl

-bash-4.1$ curl -iv --raw --header "origin: http://localhost" --header "Accept-Encoding:gzip, deflate, sdch" http://blah-blah-blah/statusUpdates
* About to connect() to blah-blah-blah (#0)
*   Trying blah-blah-blah... connected
* Connected to blah-blah-blah (#0)
> GET /statusUpdates HTTP/1.1
> User-Agent: curl/7.19.7 (x86_64-redhat-linux-gnu) libcurl/7.19.7 NSS/3.15.3 zlib/1.2.3 libidn/1.18 libssh2/1.4.2
> Host: blah-blah-blah
> Accept: */*
> origin: http://localhost
> Accept-Encoding:gzip, deflate, sdch
>
< HTTP/1.1 200 OK
HTTP/1.1 200 OK
< Date: Tue, 29 Nov 2016 23:40:27 GMT
Date: Tue, 29 Nov 2016 23:40:27 GMT
< Access-Control-Allow-Origin: http://localhost
Access-Control-Allow-Origin: http://localhost
< Access-Control-Allow-Credentials: true
Access-Control-Allow-Credentials: true
< Access-Control-Expose-Headers: Content-Length,X-Total-Count,Transfer-Encoding
Access-Control-Expose-Headers: Content-Length,X-Total-Count,Transfer-Encoding
< Content-Encoding: identity
Content-Encoding: identity
< Content-Type: application/json
Content-Type: application/json
< Transfer-Encoding: chunked
Transfer-Encoding: chunked

<

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants