HTTP.checkSecurity(): Only throw for state == 'broken'
This commit is contained in:
parent
423393c78b
commit
db5db03c9c
1 changed files with 27 additions and 31 deletions
|
@ -1263,14 +1263,14 @@ Zotero.HTTP = new function() {
|
|||
}
|
||||
|
||||
let { state, errorMessage } = SecurityInfo.getSecurityInfo(channel);
|
||||
if (state != 'broken') {
|
||||
return;
|
||||
}
|
||||
|
||||
let msg;
|
||||
let dialogButtonText;
|
||||
let dialogButtonCallback;
|
||||
if (state !== 'secure') {
|
||||
if (state === 'broken' || state === 'insecure') {
|
||||
let domain = channel.originalURI?.host ?? '';
|
||||
msg = Zotero.getString('networkError.insecureConnectionTo', [Zotero.appName, domain])
|
||||
let msg = Zotero.getString('networkError.insecureConnectionTo', [Zotero.appName, domain])
|
||||
+ "\n\n";
|
||||
if (channel.originalURI?.spec.includes(ZOTERO_CONFIG.DOMAIN_NAME)
|
||||
|| channel.originalURI?.spec.includes(ZOTERO_CONFIG.PROXY_AUTH_URL.match(/^https:\/\/([^\/]+)\//)[1])) {
|
||||
|
@ -1286,8 +1286,6 @@ Zotero.HTTP = new function() {
|
|||
dialogButtonCallback = function () {
|
||||
Zotero.launchURL('https://www.zotero.org/support/kb/ssl_certificate_error');
|
||||
};
|
||||
}
|
||||
if (msg) {
|
||||
throw new Zotero.HTTP.SecurityException(
|
||||
msg,
|
||||
{
|
||||
|
@ -1296,8 +1294,6 @@ Zotero.HTTP = new function() {
|
|||
dialogButtonCallback
|
||||
}
|
||||
);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
async function _checkRetry(req) {
|
||||
|
|
Loading…
Reference in a new issue