Skip to content

Commit

Permalink
test(parsers/multipart): add permitted whitespace and final boundary …
Browse files Browse the repository at this point in the history
…marker to tests
  • Loading branch information
Lordfirespeed committed Aug 20, 2024
1 parent 3f506d8 commit 49d21ad
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions tests/parsers/multipart-form-data.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ it('should parse valid multipart form data with a single part', () => {
'content-type: application/json',
'',
'{ "foo": "bar" }',
'--boundary',
'--boundary--',
'',
'epilogue',
].join('\r\n')
Expand Down Expand Up @@ -41,7 +41,7 @@ it('should parse valid multipart form data with multiple parts', () => {
'',
'foo bar baz',
'',
'--boundary',
'--boundary--',
'',
'epilogue',
].join('\r\n')
Expand Down
8 changes: 4 additions & 4 deletions tests/parsers/multipart.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@ import { parseMultipart } from '@/parsers/multipart'
it('should parse valid multipart with a single part', () => {
const multipart = [
'preamble',
'--boundary',
'--boundary ',
'x-content-type: application/json',
'',
'{ "foo": "bar" }',
'--boundary',
'--boundary--',
'',
'epilogue',
].join('\r\n')
Expand All @@ -31,12 +31,12 @@ it('should parse valid multipart with multiple parts', () => {
'x-content-type: application/json',
'',
'{ "foo": "bar" }',
'--boundary',
'--boundary\t ',
'content-length: 6',
'x-content-disposition: attachment',
'',
'foobar',
'--boundary',
'--boundary--',
'',
'epilogue',
].join('\r\n')
Expand Down

0 comments on commit 49d21ad

Please sign in to comment.