fix curl import params (#6)

This commit is contained in:
mooonfly
2025-05-11 21:22:36 +08:00
committed by GitHub
parent a5333deb71
commit 8be9c4c388

View File

@@ -386,14 +386,15 @@ function pairsToDataParameters(keyedPairs: FlagsByName): DataParameter[] {
for (const p of pairs) {
if (typeof p !== 'string') continue;
const [name, value] = p.split('=');
if (p.startsWith('@')) {
let params = p.split("&");
for (const param of params) {
const [name, value] = param.split('=');
if (param.startsWith('@')) {
// Yaak doesn't support files in url-encoded data, so
dataParameters.push({
name: name ?? '',
value: '',
filePath: p.slice(1),
filePath: param.slice(1),
enabled: true,
});
} else {
@@ -405,6 +406,7 @@ function pairsToDataParameters(keyedPairs: FlagsByName): DataParameter[] {
}
}
}
}
return dataParameters;
}