diff --git a/libs/http/body/src/lib/request-to-multipart-form-data/get-boundry.ts b/libs/http/body/src/lib/request-to-multipart-form-data/get-boundary.ts similarity index 85% rename from libs/http/body/src/lib/request-to-multipart-form-data/get-boundry.ts rename to libs/http/body/src/lib/request-to-multipart-form-data/get-boundary.ts index d6570fa..630c49b 100644 --- a/libs/http/body/src/lib/request-to-multipart-form-data/get-boundry.ts +++ b/libs/http/body/src/lib/request-to-multipart-form-data/get-boundary.ts @@ -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=')) diff --git a/libs/http/body/src/lib/request-to-multipart-form-data/index.ts b/libs/http/body/src/lib/request-to-multipart-form-data/index.ts index 5a0a2ff..77d93d2 100644 --- a/libs/http/body/src/lib/request-to-multipart-form-data/index.ts +++ b/libs/http/body/src/lib/request-to-multipart-form-data/index.ts @@ -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'; diff --git a/libs/http/body/src/lib/request-to-multipart-form-data/request-to-multipart-form-data.ts b/libs/http/body/src/lib/request-to-multipart-form-data/request-to-multipart-form-data.ts index 4de1d98..24cffec 100644 --- a/libs/http/body/src/lib/request-to-multipart-form-data/request-to-multipart-form-data.ts +++ b/libs/http/body/src/lib/request-to-multipart-form-data/request-to-multipart-form-data.ts @@ -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', @@ -24,7 +24,7 @@ export async function requestToMultipartFormData( ): Promise { checkContentType(req, multipartFormData); - const boundaryLine = `--${getBoundry(req)}`; + const boundaryLine = `--${getBoundary(req)}`; let lastline = ''; let bytes: number[] = []; let lastBytes: number[] = [];