make sure the default `highWaterMark` equals 16384
This commit is contained in:
parent
a6a933fa5a
commit
498710d555
|
@ -134,7 +134,7 @@ export default class Request extends Body {
|
|||
input.compress : true);
|
||||
this.counter = init.counter || input.counter || 0;
|
||||
this.agent = init.agent || input.agent;
|
||||
this.highWaterMark = init.highWaterMark || input.highWaterMark;
|
||||
this.highWaterMark = init.highWaterMark || input.highWaterMark || 16384;
|
||||
}
|
||||
|
||||
get method() {
|
||||
|
|
|
@ -1791,6 +1791,13 @@ describe('node-fetch', () => {
|
|||
);
|
||||
});
|
||||
|
||||
it('the default highWaterMark should equal 16384', () => {
|
||||
const url = `${base}hello`;
|
||||
return fetch(url).then(res => {
|
||||
expect(res.highWaterMark).to.equal(16384);
|
||||
});
|
||||
});
|
||||
|
||||
it('should timeout on cloning response without consuming one of the streams when the second packet size is equal default highWaterMark', function () {
|
||||
this.timeout(300);
|
||||
const url = local.mockResponse(res => {
|
||||
|
|
Loading…
Reference in New Issue