Skip to content

Commit

Permalink
Update response.js (#1162)
Browse files Browse the repository at this point in the history
Allow Response.clone() to persist the high water mark
  • Loading branch information
davesidious committed Oct 7, 2021
1 parent 5756eaa commit acc2cba
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/response.js
Expand Up @@ -95,7 +95,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
});
}

Expand Down
4 changes: 3 additions & 1 deletion test/response.js
Expand Up @@ -122,14 +122,16 @@ describe('Response', () => {
},
url: base,
status: 346,
statusText: 'production'
statusText: 'production',
highWaterMark: 789
});
const cl = res.clone();
expect(cl.headers.get('a')).to.equal('1');
expect(cl.type).to.equal('default');
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);
Expand Down

0 comments on commit acc2cba

Please sign in to comment.