Bug 1180330 - http auth prompt shown when opening browser if prompt canceled/dismissed earlier. r=fabrice

This commit is contained in:
Fernando Jimenez 2016-01-11 09:49:59 +01:00
parent cf8e523d4f
commit cdcdb55832
3 changed files with 11 additions and 0 deletions

View File

@ -462,6 +462,7 @@ BrowserElementParent.prototype = {
/* username and password */
let detail = {
host: authDetail.host,
path: authDetail.path,
realm: authDetail.realm,
isProxy: authDetail.isProxy
};

View File

@ -381,6 +381,7 @@ BrowserElementAuthPrompt.prototype = {
let [hostname, httpRealm] = this._getAuthTarget(channel, authInfo);
return {
host: hostname,
path: channel.URI.path,
realm: httpRealm,
username: authInfo.username,
isProxy: !!(authInfo.flags & Ci.nsIAuthInformation.AUTH_PROXY),

View File

@ -49,6 +49,9 @@ function testHttpAuthCancel(e) {
is(e.detail.realm, 'http_realm', 'expected realm matches');
is(e.detail.host, 'http://test', 'expected host matches');
is(e.detail.path,
'/tests/dom/browser-element/mochitest/file_http_401_response.sjs',
'expected path matches');
e.preventDefault();
SimpleTest.executeSoon(function() {
@ -71,6 +74,9 @@ function testHttpAuth(e) {
is(e.detail.realm, 'http_realm', 'expected realm matches');
is(e.detail.host, 'http://test', 'expected host matches');
is(e.detail.path,
'/tests/dom/browser-element/mochitest/file_http_401_response.sjs',
'expected path matches');
is(e.detail.isProxy, false, 'expected isProxy is false');
e.preventDefault();
@ -98,6 +104,9 @@ function testProxyAuth(e) {
is(e.detail.realm, 'http_realm', 'expected realm matches');
is(e.detail.host, mozproxy, 'expected host matches');
is(e.detail.path,
'/tests/dom/browser-element/mochitest/file_http_407_response.sjs',
'expected path matches');
is(e.detail.isProxy, true, 'expected isProxy is true');
e.preventDefault();