Skip to content

Instantly share code, notes, and snippets.

@catlion
Created October 7, 2011 06:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save catlion/1269579 to your computer and use it in GitHub Desktop.
Save catlion/1269579 to your computer and use it in GitHub Desktop.
NTLM authentication check for Firebug
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;
},
@catlion
Copy link
Author

catlion commented Oct 7, 2011

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment