Skip to content

Commit 16801cf

Browse files
committed
use correct options object for baseURLs
Signed-off-by: Matthew Clarke <[email protected]>
1 parent 135e899 commit 16801cf

File tree

3 files changed

+8
-6
lines changed

3 files changed

+8
-6
lines changed

lib/http.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -57,11 +57,11 @@ export default class HttpBase {
5757
this.options = this.setDefaults(options);
5858
this.rootHttp = axios.create({
5959
...options.requestConfig,
60-
baseURL: options.baseURL,
60+
baseURL: this.options.baseURL,
6161
});
6262
this.http = axios.create({
6363
...options.requestConfig,
64-
baseURL: options.namespaceBaseURL,
64+
baseURL: this.options.namespaceBaseURL,
6565
});
6666
}
6767

@@ -70,7 +70,9 @@ export default class HttpBase {
7070
if (!baseURLSet && (options.host ?? '') === '') {
7171
throw new Error('Invalid options. Option host, or baseURL and namespaceBaseURL must be set.');
7272
}
73-
73+
if ((options.host ?? '') === '' && (options.websocket?.host ?? '') === '') {
74+
throw new Error('Invalid options. Option host, or websocket.host must be set.');
75+
}
7476
return {
7577
...options,
7678
baseURL: baseURLSet ? options.baseURL : `${options.host}/api/v1`,

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@hyperledger/firefly-sdk",
3-
"version": "1.2.11",
3+
"version": "1.2.12",
44
"description": "Client SDK for Hyperledger FireFly",
55
"main": "dist/index.js",
66
"types": "dist/index.d.ts",

0 commit comments

Comments
 (0)