Skip to content

Commit d62d5a0

Browse files
committed
Added authentication to axios.defaults.proxy
1 parent 77792a5 commit d62d5a0

File tree

4 files changed

+15
-5
lines changed

4 files changed

+15
-5
lines changed

pnpm-lock.yaml

Lines changed: 5 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/node/server.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,10 @@ if (settings.dumpOnUncleanExit) {
4242
const addProxyToAxios = (url: URL) => {
4343
axios.defaults.proxy = {
4444
host: url.hostname,
45+
auth: {
46+
username: url.username,
47+
password: url.password,
48+
},
4549
port: Number(url.port),
4650
protocol: url.protocol,
4751
}

src/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,11 +44,13 @@
4444
"find-root": "1.1.0",
4545
"formidable": "^3.5.2",
4646
"http-errors": "^2.0.0",
47+
"https-proxy-agent": "^7.0.6",
4748
"jose": "^5.10.0",
4849
"js-cookie": "^3.0.5",
4950
"jsdom": "^26.0.0",
5051
"jsonminify": "0.4.2",
5152
"jsonwebtoken": "^9.0.2",
53+
"jwt-decode": "^4.0.0",
5254
"languages4translatewiki": "0.1.3",
5355
"live-plugin-manager": "^1.0.0",
5456
"lodash.clonedeep": "4.5.0",
@@ -70,7 +72,6 @@
7072
"socket.io-client": "^4.8.1",
7173
"superagent": "10.2.0",
7274
"swagger-ui-express": "^5.0.1",
73-
"jwt-decode": "^4.0.0",
7475
"tinycon": "0.6.8",
7576
"tsx": "4.19.3",
7677
"ueberdb2": "^5.0.6",

src/static/js/pluginfw/installer.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -172,12 +172,14 @@ export const getAvailablePlugins = (maxCacheAge: number|false) => {
172172
}
173173

174174
await axios.get(`${settings.updateServer}/plugins.json`, {headers})
175-
.then((pluginsLoaded:AxiosResponse<MapArrayType<PackageInfo>>) => {
175+
.then((pluginsLoaded: AxiosResponse<MapArrayType<PackageInfo>>) => {
176176
availablePlugins = pluginsLoaded.data;
177177
cacheTimestamp = nowTimestamp;
178178
resolve(availablePlugins);
179179
})
180-
.catch(async (err) => reject(err));
180+
.catch(async (err) => {
181+
logger.error(`Error fetching available plugins: ${err}`);
182+
});
181183
});
182184
};
183185

0 commit comments

Comments
 (0)