mirror of
https://github.com/Studio-Saelix/sencho.git
synced 2026-08-18 22:36:19 +00:00
fix(fleet): strip trailing slash in fetchRemoteMeta URL construction (#444)
Nodes with a trailing slash in api_url (e.g. http://host:3000/) caused fetchRemoteMeta to construct a double-slash URL (http://host:3000//api/meta), which failed silently. The update-status endpoint then returned version: null for the remote node, triggering a false "Update available" badge. Every other URL construction in the codebase already strips the trailing slash; this was the one call site that was missed.
This commit is contained in:
@@ -93,7 +93,7 @@ export function getActiveCapabilities(): readonly string[] {
|
||||
/** Fetch /api/meta from a remote Sencho instance. Returns empty data on failure. */
|
||||
export async function fetchRemoteMeta(baseUrl: string, apiToken: string): Promise<RemoteMeta> {
|
||||
try {
|
||||
const res = await axios.get(`${baseUrl}/api/meta`, {
|
||||
const res = await axios.get(`${baseUrl.replace(/\/$/, '')}/api/meta`, {
|
||||
headers: { Authorization: `Bearer ${apiToken}` },
|
||||
timeout: 5000,
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user