Repository navigation
Conversation
Automation signalsActivity patterns show signs of automation. Evidence
Last 5 PRs:
This is an automated analysis by AgentScan |
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the
|
There was a problem hiding this comment.
🟡 Changes recommended
The new tests cover built-in encoders rather than the affected legacy FormStream path, leaving escaping and synchronous rejection of CR/LF-containing MIME types without regression coverage.
1 open issue
What changed in this PR
This PR raises the 3.x branch’s minimum formstream version to secure legacy multipart headers while adding regression coverage for the existing built-in encoders.
Changes:
- Require
formstream@^1.5.3for header escaping and rejection of MIME types containing CR or LF. - Test filename and field-name escaping, unchanged field values, and Unicode filenames with both built-in encoders.
- Update the legacy upload test’s expected boundary format.
| File | Description |
|---|---|
test/options.stream.test.ts |
Update the expected multipart boundary to 24 hexadecimal characters. |
test/multipart-escaping.test.ts |
Add escaping regression tests for Undici and the Node 14 fallback encoder. |
package.json |
Raise the minimum formstream version to 1.5.3. |
Review effort: Balanced
| import { describe, it, beforeAll, afterAll, vi } from 'vitest'; | ||
| import { startServer } from './fixtures/server'; | ||
|
|
||
| describe.each([ 'Undici', 'Node 14 fallback' ])('multipart escaping with %s', encoder => { |

The
3.xbranch uses Undici orform-data-encoderfor multipart uploads, but it also accepts legacyformstreambodies.Require
formstream@^1.5.3to encode CR, LF, and double quotes in field names and filenames. MIME types containing CR or LF cause a synchronousTypeError. Preserve the existing escaping behavior in both built-in encoders.