Update response.js (#1162)
Allow Response.clone() to persist the high water mark
This commit is contained in:
parent
5756eaaec2
commit
acc2cbaebd
|
@ -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
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
@ -122,7 +122,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');
|
||||
|
@ -130,6 +131,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);
|
||||
|
|
Loading…
Reference in New Issue