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