Skip to content

Commit

Permalink
correct boundary naming
Browse files Browse the repository at this point in the history
  • Loading branch information
philiplehmann committed Jan 6, 2025
1 parent dca688d commit 58d8b9f
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { BadRequest } from '@container/http/error';
import type { IncomingMessage } from 'node:http';

export function getBoundry(req: IncomingMessage): string {
export function getBoundary(req: IncomingMessage): string {
const boundary = req.headers['content-type']
?.split('; ')
.find((v) => v.startsWith('boundary='))
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
export { getBoundry } from './get-boundry';
export { getBoundary } from './get-boundary';
export { getContentDispositionName } from './get-content-disposition-name';
export { requestToMultipartFormData } from './request-to-multipart-form-data';
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { z } from 'zod';
import type { IncomingMessage } from 'node:http';
import { Readable, Transform } from 'node:stream';
import { checkContentType } from '../check-content-type';
import { getBoundry } from './get-boundry';
import { getBoundary } from './get-boundary';

enum State {
INIT = 'INIT',
Expand All @@ -24,7 +24,7 @@ export async function requestToMultipartFormData(
): Promise<void> {
checkContentType(req, multipartFormData);

const boundaryLine = `--${getBoundry(req)}`;
const boundaryLine = `--${getBoundary(req)}`;
let lastline = '';
let bytes: number[] = [];
let lastBytes: number[] = [];
Expand Down

0 comments on commit 58d8b9f

Please sign in to comment.