We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 99e0ffd commit 575da0fCopy full SHA for 575da0f
src/stac-api/index.ts
@@ -10,9 +10,11 @@ type FetchOptions = {
10
11
class StacApi {
12
baseUrl: string;
13
+ options?: GenericObject;
14
- constructor(baseUrl: string) {
15
+ constructor(baseUrl: string, options?: GenericObject) {
16
this.baseUrl = baseUrl.endsWith('/') ? baseUrl.slice(0, -1) : baseUrl;
17
+ this.options = options;
18
}
19
20
fixBboxCoordinateOrder(bbox?: Bbox): Bbox | undefined {
@@ -79,7 +81,8 @@ class StacApi {
79
81
method,
80
82
headers: {
83
'Content-Type': 'application/json',
- ...headers
84
+ ...headers,
85
+ ...this.options?.headers
86
},
87
body: payload ? JSON.stringify(payload) : undefined
88
}).then(async (response) => {
0 commit comments