mirror of
https://github.com/usebruno/bruno.git
synced 2024-11-22 07:53:34 +01:00
refactor: now the key params in the axiosRequest creation phase is pathParams to resolve the naming conflicts of axios. (#2465)
This commit is contained in:
parent
271f988d99
commit
9588b442f7
@ -255,6 +255,10 @@ const configureRequest = async (
|
||||
request.headers['cookie'] = cookieString;
|
||||
}
|
||||
}
|
||||
|
||||
// Remove pathParams, already in URL (Issue #2439)
|
||||
delete request.pathParams;
|
||||
|
||||
return axiosInstance;
|
||||
};
|
||||
|
||||
|
@ -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 : '';
|
||||
}
|
||||
})
|
||||
|
@ -162,7 +162,7 @@ const prepareRequest = (request, collectionRoot, collectionPath) => {
|
||||
method: request.method,
|
||||
url,
|
||||
headers,
|
||||
params: request.params.filter((param) => param.type === 'path'),
|
||||
pathParams: request.params.filter((param) => param.type === 'path'),
|
||||
responseType: 'arraybuffer'
|
||||
};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user