Commit 4d438db
committed
fix(fastify): use Fastify content-type parsers instead of raw stream reading
Fastify's default body parser consumes the request stream before route
handlers run. The old code tried to read req.raw manually via collectBody/
collectRawBody, but the stream was already consumed — causing the Promise
to never resolve and the validation to hang indefinitely.
Fix:
- Register content-type parsers for text/plain, application/octet-stream,
and a catch-all so req.body is always populated
- Use req.body directly in POST /baseline11 and /upload handlers
- Remove unused collectBody/collectRawBody helpers
- Bump bodyLimit to 50MB for upload test (default 1MB is too small)1 parent 744656c commit 4d438db
1 file changed
Lines changed: 10 additions & 24 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
74 | 74 | | |
75 | 75 | | |
76 | 76 | | |
77 | | - | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
78 | 83 | | |
79 | 84 | | |
80 | 85 | | |
| |||
87 | 92 | | |
88 | 93 | | |
89 | 94 | | |
90 | | - | |
| 95 | + | |
91 | 96 | | |
92 | | - | |
93 | | - | |
| 97 | + | |
94 | 98 | | |
95 | 99 | | |
96 | 100 | | |
| |||
163 | 167 | | |
164 | 168 | | |
165 | 169 | | |
166 | | - | |
167 | | - | |
| 170 | + | |
| 171 | + | |
168 | 172 | | |
169 | 173 | | |
170 | 174 | | |
171 | | - | |
172 | | - | |
173 | | - | |
174 | | - | |
175 | | - | |
176 | | - | |
177 | | - | |
178 | | - | |
179 | | - | |
180 | | - | |
181 | | - | |
182 | | - | |
183 | | - | |
184 | | - | |
185 | | - | |
186 | | - | |
187 | | - | |
188 | | - | |
189 | 175 | | |
190 | 176 | | |
191 | 177 | | |
| |||
0 commit comments