1
0
mirror of https://github.com/laurent22/joplin.git synced 2024-12-30 10:36:35 +02:00

Desktop: recreate http agent when the protocol changes (#5016)

This commit is contained in:
Roman Musin 2021-06-07 10:19:59 +01:00 committed by GitHub
parent a7e67952b8
commit 7c45b95f6f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -487,13 +487,12 @@ function shimInit(sharp = null, keytar = null, React = null, appVersion = null)
maxSockets: 1,
keepAliveMsecs: 5000,
};
if (url.startsWith('https')) {
shim.httpAgent_ = new https.Agent(AgentSettings);
} else {
shim.httpAgent_ = new http.Agent(AgentSettings);
}
shim.httpAgent_ = {
http: new http.Agent(AgentSettings),
https: new https.Agent(AgentSettings),
};
}
return shim.httpAgent_;
return url.startsWith('https') ? shim.httpAgent_.https : shim.httpAgent_.http;
};
shim.openOrCreateFile = (filepath, defaultContents) => {