From 05e752ccf25e5b8fe56fb38339a4f295799760ab Mon Sep 17 00:00:00 2001 From: Oliver Roick Date: Wed, 25 Jan 2023 12:07:25 +1100 Subject: [PATCH] fix: Remove trailing `/` from stac baseUrl [fix #15] --- src/stac-api/index.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/stac-api/index.ts b/src/stac-api/index.ts index a93194b..94f8b87 100644 --- a/src/stac-api/index.ts +++ b/src/stac-api/index.ts @@ -12,7 +12,7 @@ class StacApi { baseUrl: string; constructor(baseUrl: string) { - this.baseUrl = baseUrl; + this.baseUrl = baseUrl.endsWith('/') ? baseUrl.slice(0, -1) : baseUrl; } fixBboxCoordinateOrder(bbox?: Bbox): Bbox | undefined {