Commit 0b1229e
authored
fix(serve-static): Use Readable.toWeb in serveStatic (#293)
The previous createStreamBody implementation used flowing mode.
This caused a flaw where data would accumulate in the queue if the transmission
speed was slower than the read speed, potentially consumig memory equal to the
file size.
However, as noted in the commit 5064e92 that
introduced this issue, using Readable.toWeb may cause an exception in Node.js
versions that do not have nodejs/node#54206 applied. Therefore, the old
implementation remains. It is desirable that it will be removed when support
for older versions of Node.js ends.1 parent 76d80e6 commit 0b1229e
1 file changed
+13
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
| 6 | + | |
| 7 | + | |
6 | 8 | | |
7 | 9 | | |
8 | 10 | | |
| |||
26 | 28 | | |
27 | 29 | | |
28 | 30 | | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
29 | 39 | | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
30 | 43 | | |
31 | 44 | | |
32 | 45 | | |
| |||
0 commit comments