From 642d6ed1c09a5d186e00cf5e3673bad2881b3b33 Mon Sep 17 00:00:00 2001 From: Ben Kelly Date: Wed, 10 Nov 2021 21:35:42 +0000 Subject: [PATCH] Make cache.put() drain the internal response body. (Fixes #1617) --- docs/index.bs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/docs/index.bs b/docs/index.bs index 9e1f5ee4..f2eb2366 100644 --- a/docs/index.bs +++ b/docs/index.bs @@ -2013,8 +2013,9 @@ spec: rfc7231; urlPrefix: https://tools.ietf.org/html/rfc7231 1. If |innerResponse|'s [=response/body=] is [=Body/disturbed=] or [=Body/locked=], return [=a promise rejected with=] a `TypeError`. 1. Let |clonedResponse| be a [=response/clone=] of |innerResponse|. 1. Let |bodyReadPromise| be [=a promise resolved with=] undefined. - 1. If |innerResponse|'s [=response/body=] is non-null, run these substeps: - 1. Let |stream| be |innerResponse|'s [=response/body=]'s [=body/stream=]. + 1. Let |body| be |innerResponse|'s [=filtered response/internal response=]'s [=response/body=] if |innerResponse| is a [=filtered response=] and |innerResponse|'s [=response/body=] otherwise. + 1. If |body| is non-null, run these substeps: + 1. Let |stream| be |body|'s [=body/stream=]. 1. Let |reader| be the result of [=ReadableStream/getting a reader=] for |stream|. 1. Set |bodyReadPromise| to the result of [=ReadableStreamDefaultReader/reading all bytes=] from |reader|.