mirror of
https://seed.radicle.dev/rad:z4V1sjrXqjvFdnCUbxPFqd5p4DtH5.git
synced 2026-11-15 19:30:38 +08:00
Allow trailing slashes in seed API
This commit is contained in:
+2
-1
@@ -14,8 +14,9 @@ export async function get(
|
||||
query[key] = val.toString();
|
||||
}
|
||||
|
||||
const base = config.seed.api.replace(/\/$/, "");
|
||||
const search = new URLSearchParams(query).toString();
|
||||
const baseUrl = `${config.seed.api}/v1/${path}`;
|
||||
const baseUrl = `${base}/v1/${path}`;
|
||||
const url = search ? `${baseUrl}?${search}` : baseUrl;
|
||||
|
||||
let response = null;
|
||||
|
||||
+1
-1
@@ -129,7 +129,7 @@ export class Config {
|
||||
withSeed(seed: string): Config {
|
||||
const cfg = {} as Config;
|
||||
Object.assign(cfg, this);
|
||||
cfg.seed.api = seed;
|
||||
cfg.seed.api = seed.replace(/\/$/, "");
|
||||
|
||||
return cfg;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user