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

X-Cache-Date and X-Atmosphere-tracking-id not properly read in jquery.atmosphere.js #679

Closed
dbaldes opened this issue Oct 10, 2012 · 2 comments

Comments

@dbaldes
Copy link

dbaldes commented Oct 10, 2012

The original code from Atmosphere 1.0.1 looks like this:

var tempDate = xdr.getResponseHeader('X-Cache-Date');
if (tempDate != null || tempDate != undefined) {
  request.lastTimestamp = tempDate.split(" ").pop();
}

tempUUID = xdr.getResponseHeader('X-Atmosphere-tracking-id');
if (tempUUID != null || tempUUID != undefined) {
  request.uuid = tempUUID.split(" ").pop();
}

There are two problems:

1st it should obviously be && instead of ||, otherwise the condition is always true,
2nd in IE8, getResponseHeader seems to return '' (empty string) instead of null or undefined, so the test fails anyway. I suggest to replace the conditions as follows:

if (tempDate != null && tempDate != undefined && tempDate != "")

and

if (tempUUID != null && tempUUID != undefined && tempUUID != "")

Without this fix, IE sends an empty X-Cache-Date parameter which leads to a NumberFormatException in HeaderBroadcasterCache:96 when it is used.

@jfarcand
Copy link
Member

Hum using the samples/chat I can't reproduce the issue (the error). Digging.

jfarcand added a commit that referenced this issue Oct 10, 2012
@dbaldes
Copy link
Author

dbaldes commented Oct 11, 2012

Well, I still get an empty string in IE8 on WinXP (I know, but we use WinXP on our IE-testing VMs) instead of null or undefined. I think it wouldn't hurt to add the empty string check as suggested??

jfarcand added a commit that referenced this issue Oct 17, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants