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 1a1cc3e commit 1d42bc3Copy full SHA for 1d42bc3
index.mjs
@@ -191,7 +191,11 @@ export default class WooCommerceRestApi {
191
Accept: "application/json"
192
};
193
// only set "User-Agent" in node environment
194
- if (typeof window === "undefined") {
+ // the checking method is identical to upstream axios
195
+ if (
196
+ typeof process !== "undefined" &&
197
+ Object.prototype.toString.call(process) === "[object process]"
198
+ ) {
199
headers["User-Agent"] =
200
"WooCommerce REST API - JS Client/" + this.classVersion;
201
}
0 commit comments