Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add highWaterMark to cloned properties #1162

Merged
merged 1 commit into from Oct 7, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/response.js
Expand Up @@ -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
});
}

Expand Down
4 changes: 3 additions & 1 deletion test/response.js
Expand Up @@ -123,14 +123,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