Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bugfix(#2439) #2465

Merged
merged 1 commit into from
Jun 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions packages/bruno-electron/src/ipc/network/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -255,6 +255,10 @@ const configureRequest = async (
request.headers['cookie'] = cookieString;
}
}

// Remove pathParams, already in URL (Issue #2439)
delete request.pathParams;

return axiosInstance;
};

Expand Down
6 changes: 3 additions & 3 deletions packages/bruno-electron/src/ipc/network/interpolate-vars.js
Original file line number Diff line number Diff line change
Expand Up @@ -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://')) {
Expand All @@ -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 : '';
}
})
Expand Down
2 changes: 1 addition & 1 deletion packages/bruno-electron/src/ipc/network/prepare-request.js
Original file line number Diff line number Diff line change
Expand Up @@ -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'
};

Expand Down