@oada/client
Advanced tools
Comparing version 2.4.1 to 2.4.2
@@ -109,8 +109,16 @@ "use strict"; | ||
let timedout = false; | ||
let signal = undefined; | ||
if (timeout) { | ||
setTimeout(() => (timedout = true), timeout); | ||
const controller = new AbortController(); | ||
({ signal } = controller); | ||
setTimeout(() => { | ||
controller.abort(); | ||
timedout = true; | ||
}, timeout); | ||
} | ||
const result = await this.context | ||
.fetch(`${this._domain}${req.path}`, { | ||
.fetch(new URL(req.path, this._domain).toString(), { | ||
method: req.method.toUpperCase(), | ||
signal, | ||
timeout, | ||
body: JSON.stringify(req.data), | ||
@@ -117,0 +125,0 @@ headers: req.headers, |
{ | ||
"name": "@oada/client", | ||
"version": "2.4.1", | ||
"version": "2.4.2", | ||
"description": "A lightweight client tool to interact with an OADA-compliant server", | ||
@@ -8,6 +8,6 @@ "repository": "https://github.com/OADA/client", | ||
"browser": { | ||
"./lib/fetch": "cross-fetch" | ||
"./dist/fetch": "cross-fetch" | ||
}, | ||
"react-native": { | ||
"./lib/fetch": "cross-fetch" | ||
"./dist/fetch": "cross-fetch" | ||
}, | ||
@@ -14,0 +14,0 @@ "types": "dist/index.d.ts", |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
67269
981