From 0aac378e5e5e2fe482e9f3da02b7f953ef057be1 Mon Sep 17 00:00:00 2001 From: "sayrer%gmail.com" Date: Wed, 7 Jun 2006 01:42:22 +0000 Subject: [PATCH] b=339530. Basic auth fails with XMLHttpRequest. r=peterv, sr=jst git-svn-id: svn://10.0.0.236/trunk@199176 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/content/base/src/nsXMLHttpRequest.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mozilla/content/base/src/nsXMLHttpRequest.cpp b/mozilla/content/base/src/nsXMLHttpRequest.cpp index ef2f10736ca..9ae1968f437 100644 --- a/mozilla/content/base/src/nsXMLHttpRequest.cpp +++ b/mozilla/content/base/src/nsXMLHttpRequest.cpp @@ -1108,7 +1108,7 @@ nsXMLHttpRequest::Open(const nsACString& method, const nsACString& url) ::JS_ValueToBoolean(cx, argv[2], &asyncBool); async = (PRBool)asyncBool; - if (argc > 3) { + if (argc > 3 && !JSVAL_IS_NULL(argv[3]) && !JSVAL_IS_VOID(argv[3])) { JSString* userStr = ::JS_ValueToString(cx, argv[3]); if (userStr) { @@ -1117,7 +1117,7 @@ nsXMLHttpRequest::Open(const nsACString& method, const nsACString& url) ::JS_GetStringLength(userStr)); } - if (argc > 4) { + if (argc > 4 && !JSVAL_IS_NULL(argv[4]) && !JSVAL_IS_VOID(argv[4])) { JSString* passwdStr = JS_ValueToString(cx, argv[4]); if (passwdStr) {