-
Notifications
You must be signed in to change notification settings - Fork 570
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
(cherry picked from commit 773ba01) Co-authored-by: Khafra <maitken033380023@gmail.com>
- Loading branch information
1 parent
5c0846d
commit de943c4
Showing
2 changed files
with
36 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
'use strict' | ||
|
||
const { test } = require('node:test') | ||
const assert = require('node:assert') | ||
const { Response } = require('../..') | ||
|
||
// https://github.com/nodejs/undici/issues/3676 | ||
test('Leading and trailing CRLFs are ignored', async (t) => { | ||
const response = new Response([ | ||
'--axios-1.7.7-boundary-bPgZ9x77LfApGVUN839vui4V7\r\n' + | ||
'Content-Disposition: form-data; name="file"; filename="doc.txt"\r\n' + | ||
'Content-Type: text/plain\r\n' + | ||
'\r\n' + | ||
'Helloworld\r\n' + | ||
'--axios-1.7.7-boundary-bPgZ9x77LfApGVUN839vui4V7--\r\n' + | ||
'\r\n' | ||
].join(''), { | ||
headers: { | ||
'content-type': 'multipart/form-data; boundary=axios-1.7.7-boundary-bPgZ9x77LfApGVUN839vui4V7' | ||
} | ||
}) | ||
|
||
await assert.doesNotReject(response.formData()) | ||
}) |