Skip to content

Commit

Permalink
Fix connection initialization
Browse files Browse the repository at this point in the history
  • Loading branch information
m-mohr committed Aug 3, 2023
1 parent da8c850 commit 35693d6
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/connection.js
Original file line number Diff line number Diff line change
Expand Up @@ -107,9 +107,7 @@ class Connection {
*/
async init() {
let response = await this._get('/');
let data = response.data;

this.capabilitiesObject = new Capabilities(data);
let data = Object.assign({}, response.data);

if (!Array.isArray(data.conformsTo) && Array.isArray(data.links)) {
let conformanceLink = this._getLinkHref(data.links, CONFORMANCE_RELS, this.baseUrl);
Expand All @@ -121,6 +119,7 @@ class Connection {
}
}

this.capabilitiesObject = new Capabilities(data);
return this.capabilitiesObject;
}

Expand Down

0 comments on commit 35693d6

Please sign in to comment.