diff --git a/keepassxc-browser/background/httpauth.js b/keepassxc-browser/background/httpauth.js index 0389247..123bad9 100755 --- a/keepassxc-browser/background/httpauth.js +++ b/keepassxc-browser/background/httpauth.js @@ -63,7 +63,11 @@ httpAuth.processPendingCallbacks = async function(details, resolve, reject) { httpAuth.requests.push(details.requestId); if (details.challenger) { - details.proxyUrl = details.challenger.host; + // Non-HTTP proxies are possible with PAC scripts, while currently only + // Firefox provides info about the proxy protocol used [1]. + // [1] https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/API/webRequest/onAuthRequired + let scheme = details.proxyInfo ? details.proxyInfo.type : 'http'; + details.proxyUrl = scheme + '://' + details.challenger.host; } details.searchUrl = (details.isProxy && details.proxyUrl) ? details.proxyUrl : details.url;