mirror of
https://github.com/mountain-loop/yaak.git
synced 2026-04-20 07:41:22 +02:00
Import content-type from Postman multi-part form
This commit is contained in:
@@ -180,6 +180,7 @@ function importBody(rawBody: any): Pick<HttpRequest, 'body' | 'bodyType' | 'head
|
|||||||
f.src != null
|
f.src != null
|
||||||
? {
|
? {
|
||||||
enabled: !f.disabled,
|
enabled: !f.disabled,
|
||||||
|
contentType: f.contentType ?? null,
|
||||||
name: f.key ?? '',
|
name: f.key ?? '',
|
||||||
file: f.src ?? '',
|
file: f.src ?? '',
|
||||||
}
|
}
|
||||||
@@ -244,6 +245,7 @@ function convertTemplateSyntax<T>(obj: T): T {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const idCount: Partial<Record<Model['model'], number>> = {};
|
const idCount: Partial<Record<Model['model'], number>> = {};
|
||||||
|
|
||||||
function generateId(model: Model['model']): string {
|
function generateId(model: Model['model']): string {
|
||||||
idCount[model] = (idCount[model] ?? -1) + 1;
|
idCount[model] = (idCount[model] ?? -1) + 1;
|
||||||
return `GENERATE_ID::${model.toUpperCase()}_${idCount[model]}`;
|
return `GENERATE_ID::${model.toUpperCase()}_${idCount[model]}`;
|
||||||
|
|||||||
@@ -131,6 +131,7 @@ function j(e) {
|
|||||||
form: b(t.formdata).map(
|
form: b(t.formdata).map(
|
||||||
(n) => n.src != null ? {
|
(n) => n.src != null ? {
|
||||||
enabled: !n.disabled,
|
enabled: !n.disabled,
|
||||||
|
contentType: n.contentType ?? null,
|
||||||
name: n.key ?? "",
|
name: n.key ?? "",
|
||||||
file: n.src ?? ""
|
file: n.src ?? ""
|
||||||
} : {
|
} : {
|
||||||
|
|||||||
Reference in New Issue
Block a user