fix: Improve login, server selection and proxy configuration (#2511)

No potentially malicious URLs referenced in markdown; added
servers stays in server selector list; the currently active server
is visible on the bottom right of smaller screens; a proxy configuration
can be provided now and works; a trailing slash in the added server
is no problem anymore, because it's removed.

FIXES: WEB-193
This commit is contained in:
Felix van Hove
2025-06-11 11:32:36 -06:00
committed by GitHub
parent 46c4a1988d
commit b4503d34f3
6 changed files with 24 additions and 15 deletions
+7 -5
View File
@@ -1,6 +1,6 @@
'use strict';
const HttpsProxyAgent = require('https-proxy-agent');
const { HttpsProxyAgent } = require('https-proxy-agent');
/*
* API proxy configuration.
@@ -19,9 +19,9 @@ const proxyConfig = [
];
/*
* Configures a corporate proxy agent for the API proxy if needed.
* Configures a proxy agent for the API proxy if needed.
*/
function setupForCorporateProxy(proxyConfig) {
function setupForProxy(proxyConfig) {
if (!Array.isArray(proxyConfig)) {
proxyConfig = [proxyConfig];
}
@@ -30,14 +30,16 @@ function setupForCorporateProxy(proxyConfig) {
let agent = null;
if (proxyServer) {
console.log(`Using corporate proxy server: ${proxyServer}`);
console.log(`Using proxy server: ${proxyServer}`);
agent = new HttpsProxyAgent(proxyServer);
proxyConfig.forEach((entry) => {
entry.agent = agent;
});
} else {
console.warn('No proxy server configured. API requests will not be proxied.');
}
return proxyConfig;
}
module.exports = setupForCorporateProxy(proxyConfig);
module.exports = setupForProxy(proxyConfig);