Created
October 7, 2011 06:13
-
-
Save catlion/1269579 to your computer and use it in GitHub Desktop.
NTLM authentication check for Firebug
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
isCorrectNtlm: function(file) | |
{ | |
var resp = file.responseHeadersText.match(/www-authenticate:\s(.+)/i)[1]; // file.responseHeaders is undefined here | |
return (resp && resp.search(/ntlm|negotiate/i) >= 0); | |
}, | |
isError: function(file) | |
{ | |
if (file.aborted) | |
return true; | |
if (file.responseStatus == 401) | |
{ | |
if (this.isCorrectNtlm(file) == true) | |
return false; | |
} | |
var errorRange = Math.floor(file.responseStatus/100); | |
return errorRange == 4 || errorRange == 5; | |
}, |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
http://code.google.com/p/fbug/issues/detail?id=4758