summaryrefslogtreecommitdiff
path: root/cli/js
diff options
context:
space:
mode:
authorMarcos Casagrande <marcoscvp90@gmail.com>2020-06-03 15:43:11 +0200
committerGitHub <noreply@github.com>2020-06-03 09:43:11 -0400
commita1915a0d4fd7d760c234e209967d842f851628d5 (patch)
tree951302fc16b36b9cc459049919d4681cc1907d18 /cli/js
parentaaa2ed5a6450572d90fdb3fc2f0000759599d46f (diff)
fix(fetch): Support 101 status code (#6059)
Diffstat (limited to 'cli/js')
-rw-r--r--cli/js/web/fetch.ts7
1 files changed, 4 insertions, 3 deletions
diff --git a/cli/js/web/fetch.ts b/cli/js/web/fetch.ts
index 1f0242a96..47ed1a7d1 100644
--- a/cli/js/web/fetch.ts
+++ b/cli/js/web/fetch.ts
@@ -12,7 +12,7 @@ import { DomFileImpl } from "./dom_file.ts";
import { getHeaderValueParams } from "./util.ts";
import { ReadableStreamImpl } from "./streams/readable_stream.ts";
-const NULL_BODY_STATUS = [/* 101, */ 204, 205, 304];
+const NULL_BODY_STATUS = [101, 204, 205, 304];
const REDIRECT_STATUS = [301, 302, 303, 307, 308];
const responseData = new WeakMap();
@@ -115,7 +115,7 @@ export class Response extends Body.Body implements domTypes.Response {
this.url = url;
this.statusText = statusText;
- this.status = status;
+ this.status = extraInit.status || status;
this.headers = headers;
this.redirected = extraInit.redirected;
this.type = type;
@@ -329,7 +329,7 @@ export async function fetch(
}
responseInit = {
- status: fetchResponse.status,
+ status: 200,
statusText: fetchResponse.statusText,
headers: fetchResponse.headers,
};
@@ -337,6 +337,7 @@ export async function fetch(
responseData.set(responseInit, {
redirected,
rid: fetchResponse.bodyRid,
+ status: fetchResponse.status,
url,
});