@fabriktor/client 0.0.16 → 0.0.18
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/src/core/http.js +4 -1
- package/package.json +1 -1
package/dist/src/core/http.js
CHANGED
|
@@ -13,6 +13,9 @@ export class WebFetcher {
|
|
|
13
13
|
return await fetch(input, init);
|
|
14
14
|
}
|
|
15
15
|
}
|
|
16
|
+
function noContent(res) {
|
|
17
|
+
return res.status === 204 || res.status === 205;
|
|
18
|
+
}
|
|
16
19
|
export class HTTPClient {
|
|
17
20
|
fetcher;
|
|
18
21
|
constructor(opts) {
|
|
@@ -33,7 +36,7 @@ export class HTTPClient {
|
|
|
33
36
|
if (!res.ok) {
|
|
34
37
|
return await fail(res);
|
|
35
38
|
}
|
|
36
|
-
if (res
|
|
39
|
+
if (noContent(res)) {
|
|
37
40
|
return undefined;
|
|
38
41
|
}
|
|
39
42
|
try {
|