Enhancement: support speedtest v1.2 API (#4695)

This commit is contained in:
shamoon 2025-02-02 19:11:08 -08:00 committed by GitHub
parent cbacf458b2
commit 07dff4c8a5
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 26 additions and 9 deletions

View file

@ -432,7 +432,7 @@ export function cleanServiceGroups(groups) {
// frigate
enableRecentEvents,
// beszel, glances, immich, mealie, pihole, pfsense
// beszel, glances, immich, mealie, pihole, pfsense, speedtest
version,
// glances
@ -610,7 +610,7 @@ export function cleanServiceGroups(groups) {
if (snapshotHost) widget.snapshotHost = snapshotHost;
if (snapshotPath) widget.snapshotPath = snapshotPath;
}
if (["beszel", "glances", "immich", "mealie", "pfsense", "pihole"].includes(type)) {
if (["beszel", "glances", "immich", "mealie", "pfsense", "pihole", "speedtest"].includes(type)) {
if (version) widget.version = parseInt(version, 10);
}
if (type === "glances") {

View file

@ -99,6 +99,11 @@ export default async function credentialedProxyHandler(req, res, map) {
headers.Authorization = widget.password;
} else if (widget.type === "gitlab") {
headers["PRIVATE-TOKEN"] = widget.key;
} else if (widget.type === "speedtest") {
if (widget.key) {
// v1 does not require a key
headers.Authorization = `Bearer ${widget.key}`;
}
} else {
headers["X-API-Key"] = `${widget.key}`;
}