gklyne / admiral-jiscmrd

Automatically exported from code.google.com/p/admiral-jiscmrd
MIT License
0 stars 0 forks source link

Issue with content negotiation ( returns JSON instead of HTML ) #32

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
---------------------------------------
1. Open a submitted Dataset on Safari/Google Chrome from Databank.
2. The pages display ok on all the other browsers but for Safari and G Chrome.

What is the expected output? What do you see instead?
-----------------------------------------------------
The page is displayed with JSON contents instead of the HTML.

Additional information:-
-------------------------------------------------------------

Of all the pages only one page
does not appear properly on Safari and Google Chrome.

Just wanted to bring to your notice that the page:
Example:
https://zoo-admiral-ibrg.zoo.ox.ac.uk/admiral-test/datasets/TestUser1
ie.
(ADMIRAL proxies the above link to
http://databank.ora.ox.ac.uk/admiral-test/datasets/TestUser1
)

is not displaying properly on Safari and Google Chrome but works fine on
Firefox.

This I guess is because of the content negotiation proble between
ADMIRAL and Databank.

Firefox displays properly as the returned data from Databank comes as
html.
Safari does not display properly as the data from the Databank comes as
json.

Find below the traces from Wireshark. Please note the order of the
accept headers which is causing a problem.

Firefox
-------
HTTP    GET /admiral-test/datasets/TestLeader HTTP/1.1 
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
\r\n

Safari
-------
HTTP    GET /admiral-test/datasets/TestUser1 HTTP/1.1 
Accept: application/xml,application/xhtml
+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5\r\n

Original issue reported on code.google.com by bhavana....@gmail.com on 7 Mar 2011 at 11:52

GoogleCodeExporter commented 8 years ago
If this is closed, check Issue 1 and close it.

Original comment by bhavana....@gmail.com on 7 Mar 2011 at 11:52

GoogleCodeExporter commented 8 years ago

Original comment by bhavana....@gmail.com on 7 Mar 2011 at 12:01

GoogleCodeExporter commented 8 years ago
It certainly is a content negotiation problem. I can see the mistakes I am 
making at my end. I have been gathering logs for the past few days to compare 
the accept headers sent by different browsers. I'll try to work on this 
tomorrow/Thursday, but will let you know before I start as this is surely going 
to effect things at your end.

Original comment by anus...@gmail.com on 8 Mar 2011 at 8:20

GoogleCodeExporter commented 8 years ago
[deleted comment]
GoogleCodeExporter commented 8 years ago
Hello Bhavana,
I've done some changes and would like to test the system.
Could you let me know of a good time for me to deploy these changes on
databank?
I don't want to disrupt any work you'all are doing with it.

Also, would it be possible for me to test things using your javascript
interface?

Regards,
Anusha

Original comment by bhavana....@gmail.com on 15 Mar 2011 at 3:37

GoogleCodeExporter commented 8 years ago
[deleted comment]
GoogleCodeExporter commented 8 years ago
Anusha,
             Thanks for your reply. 
I am currently working on a different issue. So do feel free to go ahead with 
your testing and deployment.
Currently we are proxying to databank from our VM and when we try to display 
dataset information, we are having in this issue.

You could take a look at the following link:
https://zoo-admiral-ibrg.zoo.ox.ac.uk/admiral-test/datasets/TestUser1

Since this is proxied to databank, it  is the same as:
http://databank.ora.ox.ac.uk/admiral-test/datasets/TestUser1

The page displays ok on Firefox, but not on  Safari and Google Chrome.

There is no javascript involved in doing this as an ajax call.
Its just a plain html href link that takes you onto that page.

Please let me know if you need further details.

Thanks and Regards,
Bhavana Ananda

Original comment by bhavana....@gmail.com on 15 Mar 2011 at 3:38

GoogleCodeExporter commented 8 years ago
Hi Anusha,

Forgot to mention one more thing.
The GET you see in the issue's "Additional information" section is actually the 
trace obtained from Wireshark when you actually click on the href link. And the 
accept headers are the browsers' defaults.
I am not requesting for any particular content-type as I am not doing an AJAX 
call. I am simply navigating to the page pointed to by the hyperlink.

Thanks and Regards,
Bhavana Ananda

Original comment by bhavana....@gmail.com on 15 Mar 2011 at 3:38

GoogleCodeExporter commented 8 years ago
Hi Bhavana,
Thanks. I realize that. Accessing a page using the browser's default
accept headers seem to work.

I would like to test the response using the ajax interface to see if
ajax calls made from different browsers produce the expected result.
Looks like the interface needs a username and password (I tried
https://zoo-admiral-ibrg.zoo.ox.ac.uk/data) for this. Can I get one?
Otherwise, could you have a look to see if things are working using the
interface (accessing the data page, posting a file, creating a
dataset...) when time permits. 

Let me know how you get along.

Regards,
Anusha 

Original comment by bhavana....@gmail.com on 15 Mar 2011 at 4:48

GoogleCodeExporter commented 8 years ago
Hi Anusha,

The password when asked for ibrg link is 
username: ____________ [Credentials were emailed to Anusha]
password: ************

I just took a look at the link
 https://zoo-admiral-ibrg.zoo.ox.ac.uk/admiral-test/datasets/TestUser1

This now works ok and is returning html instead of json.

However I notice new problems: 

View submitted datasets: 
https://zoo-admiral-ibrg.zoo.ox.ac.uk/tool/SelectDataset/html/SelectDataset.html
and 
Dataset summary page: 
https://zoo-admiral-ibrg.zoo.ox.ac.uk/tool/SubmitDatasetHandler/cgi-bin/SubmitDa
tasetConfirmationHandler.py
are having problems.
These two pages worked fine an hour ago. The reason for the problem is that 
these two pages are now returning html instead of json. ie. Expected 
application/json but  got text/html

You can however confirm this effect with the credentials I stated previously.

Many thanks.

Regards,
Bhavana Ananda

Original comment by bhavana....@gmail.com on 15 Mar 2011 at 4:49

GoogleCodeExporter commented 8 years ago

Original comment by bhavana....@gmail.com on 15 Mar 2011 at 5:20

GoogleCodeExporter commented 8 years ago
Hi Anusha,

Issue 32 is now fixed. All the other pages are working as desired.
I will close this issue as fixed. Thanks for your help.

Regards,
Bhavana Ananda

Original comment by bhavana....@gmail.com on 16 Mar 2011 at 10:16

GoogleCodeExporter commented 8 years ago

Original comment by bhavana....@gmail.com on 16 Mar 2011 at 10:17