From c5ef70d87e27e0bccb55f5a7c93430665ebae56c Mon Sep 17 00:00:00 2001 From: davesidious Date: Tue, 18 May 2021 15:46:43 +0200 Subject: [PATCH] Update response.js Allow Response.clone() to persist the high water mark --- src/response.js | 3 ++- test/response.js | 4 +++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/response.js b/src/response.js index 7e6c5c7d4..bc1a68950 100644 --- a/src/response.js +++ b/src/response.js @@ -93,7 +93,8 @@ export default class Response extends Body { headers: this.headers, ok: this.ok, redirected: this.redirected, - size: this.size + size: this.size, + highWaterMark: this.highWaterMark }); } diff --git a/test/response.js b/test/response.js index 8de19d626..aa4bac1c0 100644 --- a/test/response.js +++ b/test/response.js @@ -123,7 +123,8 @@ describe('Response', () => { }, url: base, status: 346, - statusText: 'production' + statusText: 'production', + highWaterMark: 789 }); const cl = res.clone(); expect(cl.headers.get('a')).to.equal('1'); @@ -131,6 +132,7 @@ describe('Response', () => { expect(cl.url).to.equal(base); expect(cl.status).to.equal(346); expect(cl.statusText).to.equal('production'); + expect(cl.highWaterMark).to.equal(789) expect(cl.ok).to.be.false; // Clone body shouldn't be the same body expect(cl.body).to.not.equal(body);