|
|
@@ -1,7 +1,7 @@ |
|
|
|
import { IncomingMessage } from 'http'; |
|
|
|
import { getFormValues } from '@theoryofnekomata/formxtra'; |
|
|
|
import { |
|
|
|
ENCTYPE_APPLICATION_JSON, |
|
|
|
ENCTYPE_APPLICATION_JSON, ENCTYPE_APPLICATION_OCTET_STREAM, |
|
|
|
ENCTYPE_MULTIPART_FORM_DATA, |
|
|
|
ENCTYPE_X_WWW_FORM_URLENCODED, |
|
|
|
} from '../common'; |
|
|
@@ -66,7 +66,7 @@ export const DEFAULT_ENCTYPE_DESERIALIZERS: EncTypeDeserializerMap = { |
|
|
|
|
|
|
|
export const deserializeBody = async (params: DeserializeBodyParams) => { |
|
|
|
const { req, deserializers = DEFAULT_ENCTYPE_DESERIALIZERS } = params; |
|
|
|
const contentType = req.headers['content-type'] ?? 'application/octet-stream'; |
|
|
|
const contentType = req.headers['content-type'] ?? ENCTYPE_APPLICATION_OCTET_STREAM; |
|
|
|
|
|
|
|
if (contentType?.startsWith(`${ENCTYPE_MULTIPART_FORM_DATA};`)) { |
|
|
|
return parseMultipartFormData(req); |
|
|
|