Skip to content

Commit 65880b0

Browse files
Set parse URL independent of browser window
parse url independent of browser window to avoid crash in SSR, as current plugin breaks SSR due to default `window` use from `Url` parser
1 parent 70c9019 commit 65880b0

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

index.mjs

+2-2
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ export default class WooCommerceRestApi {
9595
return url;
9696
}
9797

98-
const query = new Url(url, null, true).query;
98+
const query = new Url(url, {}, true).query;
9999
const values = [];
100100

101101
let queryString = "";
@@ -140,7 +140,7 @@ export default class WooCommerceRestApi {
140140

141141
// Include port.
142142
if (this.port !== "") {
143-
const hostname = new Url(url).hostname;
143+
const hostname = new Url(url, {}).hostname;
144144

145145
url = url.replace(hostname, hostname + ":" + this.port);
146146
}

0 commit comments

Comments
 (0)