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

Wrong content length header #93

Open
herzaso opened this issue Oct 13, 2015 · 1 comment
Open

Wrong content length header #93

herzaso opened this issue Oct 13, 2015 · 1 comment

Comments

@herzaso
Copy link

herzaso commented Oct 13, 2015

Server: Tornado 4.2.1 and sockjs 1.0.2
Client: Javascript, Firefox

I'm trying to establish a realtime connection from a local file (file:///) to a remote server.
The response headers I get from a call to "http://://info?t=1444720615830" are:

Access-Control-Allow-Credentials: true
Access-Control-Allow-Origin: *
Cache-Control: no-store, no-cache, must-revalidate, max-age=0
Content-Length: 87
Content-Type: application/json; charset=UTF-8
Date: Tue, 13 Oct 2015 07:17:08 GMT
Etag: "eef3578f083ee9ef36b811fe004fbd996ac00192"
Server: TornadoServer/4.2.1

while in the response body I get "SyntaxError: JSON.parse: unexpected end of data at line 1 column 1 of the JSON data"

I Firefox developer tools, there is a button to "Edit and Resend" a request and when I do it (resend without editing" I get a different response headers:

Access-Control-Allow-Credentials: true
Access-Control-Allow-Origin: *
Cache-Control: no-store, no-cache, must-revalidate, max-age=0
Content-Length: 85
Content-Type: application/json; charset=UTF-8
Date: Tue, 13 Oct 2015 07:21:52 GMT
Etag: "529027274ad34b6e2600bbfb60e10e7322506ea0"
Server: TornadoServer/4.2.1

(I marked the differences in bold)

The response body of the resent request is now a valid JSON object
{origins: [':'], websocket: true, cookie_needed: true, entropy: 16239493526095616}

Am I missing something or is there a problem with the content length?

@herzaso
Copy link
Author

herzaso commented Oct 13, 2015

It appears that this issue is that same as issue #177
After overriding the preflight with Access-Control-Allow-Origin=null, it works (no relation to the content length)...

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

1 participant