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

Inconsistent responses across browsers #31

Open
rbkreisberg opened this issue Jun 27, 2014 · 0 comments
Open

Inconsistent responses across browsers #31

rbkreisberg opened this issue Jun 27, 2014 · 0 comments
Labels

Comments

@rbkreisberg
Copy link
Contributor

The PrettyJsonRequest class used for the MongoDB Query handler is problematic.

In Firefox, the default setting for XHR's (Ajax requests) is to have the "Accept" header with value equal to "text/html,application/xhtml+xml,application/xml;q=0.9,/;q=0.8". This triggers the Tornado handler response to be written in the pretty html.

Google Chrome sets the "Accept" header to "/" by default. Ajax requests sent from Chrome and Safari do not trigger the PrettyJson write function.

Recreate bug for Firefox:

  1. Set the browser address to http://explorer.cancerregulome.org/all_pairs/?dataset=brca_pw_manuscript
  2. Open the web console developer tool.
  3. Paste the following into the console.
function reqListener () {
  console.log(this.responseText);
}
var url = 'http://explorer.cancerregulome.org/addama/services/datastores/dev_ffn_20140520/STAD/feature_matrix?_include=id&_include=label&source=CLIN&source=SAMP';
var oReq = new XMLHttpRequest();
oReq.onload = reqListener;
oReq.open("get", url, true);
oReq.send();

The response will either be in HTML.

Doing the same in Chrome will result in a JSON response.

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

1 participant