mirror of
https://github.com/usebruno/bruno.git
synced 2024-11-24 17:03:47 +01: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);
|
||||
}
|
||||
|
||||
each(request.params, (param) => {
|
||||
each(request.pathParams, (param) => {
|
||||
param.value = _interpolate(param.value);
|
||||
});
|
||||
|
||||
if (request?.params?.length) {
|
||||
if (request?.pathParams?.length) {
|
||||
let url = request.url;
|
||||
|
||||
if (!url.startsWith('http://') && !url.startsWith('https://')) {
|
||||
@ -107,7 +107,7 @@ const interpolateVars = (request, envVars = {}, collectionVariables = {}, proces
|
||||
return '/' + path;
|
||||
} else {
|
||||
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 : '';
|
||||
}
|
||||
})
|
||||
|
@ -29,7 +29,8 @@ const prepareRequest = (request, collectionRoot) => {
|
||||
let axiosRequest = {
|
||||
method: request.method,
|
||||
url: request.url,
|
||||
headers: headers
|
||||
headers: headers,
|
||||
pathParams: request?.params?.filter((param) => param.type === 'path')
|
||||
};
|
||||
|
||||
const collectionAuth = get(collectionRoot, 'request.auth');
|
||||
|
Loading…
Reference in New Issue
Block a user