mirror of
https://github.com/usebruno/bruno.git
synced 2025-06-20 03:38:17 +02:00
Co-authored-by: Fabio Grande <fabio.grande@hdhome.it>
This commit is contained in:
parent
9f76834b2f
commit
b2038c7cc2
@ -82,11 +82,11 @@ const interpolateVars = (request, envVars = {}, collectionVariables = {}, proces
|
|||||||
request.data = _interpolate(request.data);
|
request.data = _interpolate(request.data);
|
||||||
}
|
}
|
||||||
|
|
||||||
each(request.params, (param) => {
|
each(request.pathParams, (param) => {
|
||||||
param.value = _interpolate(param.value);
|
param.value = _interpolate(param.value);
|
||||||
});
|
});
|
||||||
|
|
||||||
if (request?.params?.length) {
|
if (request?.pathParams?.length) {
|
||||||
let url = request.url;
|
let url = request.url;
|
||||||
|
|
||||||
if (!url.startsWith('http://') && !url.startsWith('https://')) {
|
if (!url.startsWith('http://') && !url.startsWith('https://')) {
|
||||||
@ -107,7 +107,7 @@ const interpolateVars = (request, envVars = {}, collectionVariables = {}, proces
|
|||||||
return '/' + path;
|
return '/' + path;
|
||||||
} else {
|
} else {
|
||||||
const name = path.slice(1);
|
const name = path.slice(1);
|
||||||
const existingPathParam = request.params.find((param) => param.type === 'path' && param.name === name);
|
const existingPathParam = request.pathParams.find((param) => param.type === 'path' && param.name === name);
|
||||||
return existingPathParam ? '/' + existingPathParam.value : '';
|
return existingPathParam ? '/' + existingPathParam.value : '';
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
@ -29,7 +29,8 @@ const prepareRequest = (request, collectionRoot) => {
|
|||||||
let axiosRequest = {
|
let axiosRequest = {
|
||||||
method: request.method,
|
method: request.method,
|
||||||
url: request.url,
|
url: request.url,
|
||||||
headers: headers
|
headers: headers,
|
||||||
|
pathParams: request?.params?.filter((param) => param.type === 'path')
|
||||||
};
|
};
|
||||||
|
|
||||||
const collectionAuth = get(collectionRoot, 'request.auth');
|
const collectionAuth = get(collectionRoot, 'request.auth');
|
||||||
|
Loading…
x
Reference in New Issue
Block a user