smaudet / scriptno

Automatically exported from code.google.com/p/scriptno
0 stars 0 forks source link

401 unauthorized requests report error but with success response text #263

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Simple website with windows authentication, domain is trusted
2. Load the webpage
3. With the site open, an iisreset was done on the server (to force the 
authentication to expire)
4. Take an action on the page that will cause data to be requested from the 
server via ajax. 

What is the expected output? What do you see instead?

Expect the resource to be loaded and the .done handler of the ajax call to be 
executed.

The .fail handler is executed with a status of error, however, the responseText 
property is the correct data. Using fiddler, I can see that there are 3 
requests for the resource (2x401 to negotiate and a 200 with the data), but the 
jqXHR that I see in code has the status of the first request (i.e. a 401 
error), and the responseText of the final successful call.

What version of the product are you using? On what operating system?
Windows 8.1, iis 8.5, chrome 35.0.1916.114 m

Please provide any additional information below.

I would expect that if a domain is trusted, then the requests to it shouldn't 
be interfered with at all, despite the incorrect handling of authentication 
negotiation.

in the snippet below, the .status property is 401, yet the .responseText 
property is the result of the 200 response. I shouldn't need to mention that 
disabling the extension resolved the issue. This makes ScriptSafe of reduced 
value in an intranet environment where windown authentication with a low 
lifetime would be used (e.g. the environment I write applications for).

jqXhr.fail(function (jqXHR, textStatus, errorThrown) {
                                //get the error message
                                var errorMessage = null;
                                if (jqXHR.status !== 0) {
                                    var errorString = jqXHR.responseText;

Original issue reported on code.google.com by david.i....@gmail.com on 10 Jun 2014 at 11:12