Commit 343fde2
fix(webapp): apply streaming content-type bypass on patchedEnd too
patchedWrite checks isStreamingContentType() before buffering; patchedEnd
only had the headersSent half. A 5xx response that sets a streaming
content-type and delivers its body via single-call res.end(chunk) would
get buffered, UTF-8 decoded, and run through the leak regex — wrong
shape for binary/SSE payloads. Mirrors the patchedWrite guard so the
same bypass applies regardless of write/end call shape.
Test pins the contract: a 5xx octet-stream body whose bytes contain
"P1001" passes through unchanged.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent 05c5e18 commit 343fde2
2 files changed
Lines changed: 45 additions & 9 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
104 | 104 | | |
105 | 105 | | |
106 | 106 | | |
107 | | - | |
108 | | - | |
109 | | - | |
110 | | - | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
111 | 114 | | |
112 | 115 | | |
113 | 116 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
238 | 238 | | |
239 | 239 | | |
240 | 240 | | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
241 | 275 | | |
242 | | - | |
243 | | - | |
244 | | - | |
245 | | - | |
246 | | - | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
247 | 280 | | |
248 | 281 | | |
249 | 282 | | |
| |||
0 commit comments