Skip to content

Commit f5dfdc6

Browse files
committed
put ending of stream into callback of write
1 parent f84e78b commit f5dfdc6

1 file changed

Lines changed: 9 additions & 6 deletions

File tree

test/fetch/encoding.js

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,9 @@ test('content-encoding header is case-iNsENsITIve', async (t) => {
2121

2222
gzip.pipe(brotli).pipe(res)
2323

24-
gzip.write(text)
25-
gzip.end()
24+
gzip.write(text, () => {
25+
gzip.end()
26+
})
2627
}).listen(0)
2728

2829
t.after(closeServerAsPromise(server))
@@ -47,8 +48,9 @@ test('response decompression according to content-encoding should be handled in
4748

4849
deflate.pipe(gzip).pipe(res)
4950

50-
deflate.write(text)
51-
deflate.end()
51+
deflate.write(text, () => {
52+
deflate.end()
53+
})
5254
}).listen(0)
5355

5456
t.after(closeServerAsPromise(server))
@@ -71,8 +73,9 @@ test('should decompress zstandard response',
7173
res.setHeader('Content-Type', 'text/plain')
7274

7375
zstd.pipe(res)
74-
zstd.write(text)
75-
zstd.end()
76+
zstd.write(text, () => {
77+
zstd.end()
78+
})
7679
}
7780
).listen(0)
7881
t.after(closeServerAsPromise(server))

0 commit comments

Comments
 (0)