From ac672489b6053c490334d9de9fb14590ab312e49 Mon Sep 17 00:00:00 2001 From: Apoorv Mittal Date: Wed, 22 Jul 2026 22:48:55 +0530 Subject: [PATCH 1/4] fix: normalizes the path to POSIX format --- packages/bruno-cli/src/runner/prepare-request.js | 2 ++ packages/bruno-cli/src/utils/form-data.js | 2 ++ 2 files changed, 4 insertions(+) diff --git a/packages/bruno-cli/src/runner/prepare-request.js b/packages/bruno-cli/src/runner/prepare-request.js index e132f3e09dc..d457d6435bf 100644 --- a/packages/bruno-cli/src/runner/prepare-request.js +++ b/packages/bruno-cli/src/runner/prepare-request.js @@ -406,6 +406,8 @@ const prepareRequest = async (item = {}, collection = {}) => { axiosRequest.headers['content-type'] = contentType; if (filePath) { + // Normalize to POSIX format for cross-platform compatibility + filePath = path.posix.normalize(filePath.replace(/\\/g, '/')); if (!path.isAbsolute(filePath)) { filePath = path.join(collectionPath, filePath); } diff --git a/packages/bruno-cli/src/utils/form-data.js b/packages/bruno-cli/src/utils/form-data.js index 9bff10442a2..d431c086f06 100644 --- a/packages/bruno-cli/src/utils/form-data.js +++ b/packages/bruno-cli/src/utils/form-data.js @@ -26,6 +26,8 @@ const createFormData = (data, collectionPath) => { const filePaths = value || []; filePaths.forEach((filePath) => { let trimmedFilePath = filePath.trim(); + // Normalize to POSIX format for cross-platform compatibility + trimmedFilePath = path.posix.normalize(trimmedFilePath.replace(/\\/g, '/')); if (!path.isAbsolute(trimmedFilePath)) { trimmedFilePath = path.join(collectionPath, trimmedFilePath); } From 095f6e2433097b2cee6e218facabd55bc631db71 Mon Sep 17 00:00:00 2001 From: Apoorv Mittal Date: Wed, 22 Jul 2026 23:00:06 +0530 Subject: [PATCH 2/4] Potential fix for pull request finding Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> --- packages/bruno-cli/src/utils/form-data.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/packages/bruno-cli/src/utils/form-data.js b/packages/bruno-cli/src/utils/form-data.js index d431c086f06..900ec76e616 100644 --- a/packages/bruno-cli/src/utils/form-data.js +++ b/packages/bruno-cli/src/utils/form-data.js @@ -26,8 +26,11 @@ const createFormData = (data, collectionPath) => { const filePaths = value || []; filePaths.forEach((filePath) => { let trimmedFilePath = filePath.trim(); - // Normalize to POSIX format for cross-platform compatibility - trimmedFilePath = path.posix.normalize(trimmedFilePath.replace(/\\/g, '/')); + // Normalize Windows separators when running on POSIX, without breaking UNC paths on Windows + if (path.sep === '/') { + trimmedFilePath = trimmedFilePath.replace(/\\/g, '/'); + } + trimmedFilePath = path.normalize(trimmedFilePath); if (!path.isAbsolute(trimmedFilePath)) { trimmedFilePath = path.join(collectionPath, trimmedFilePath); } From c27af490d02a4ad78994e11b25f272627694d9a4 Mon Sep 17 00:00:00 2001 From: Apoorv Mittal Date: Wed, 22 Jul 2026 23:28:47 +0530 Subject: [PATCH 3/4] fix: normalize windows separators without breaking UNC paths --- packages/bruno-cli/src/runner/prepare-request.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/packages/bruno-cli/src/runner/prepare-request.js b/packages/bruno-cli/src/runner/prepare-request.js index d457d6435bf..bc513f0aa9c 100644 --- a/packages/bruno-cli/src/runner/prepare-request.js +++ b/packages/bruno-cli/src/runner/prepare-request.js @@ -406,8 +406,11 @@ const prepareRequest = async (item = {}, collection = {}) => { axiosRequest.headers['content-type'] = contentType; if (filePath) { - // Normalize to POSIX format for cross-platform compatibility - filePath = path.posix.normalize(filePath.replace(/\\/g, '/')); + // Normalize Windows separators when running on POSIX, without breaking UNC paths on Windows + if (path.sep === '/') { + filePath = filePath.replace(/\\/g, '/'); + } + filePath = path.normalize(filePath); if (!path.isAbsolute(filePath)) { filePath = path.join(collectionPath, filePath); } From 7100f8ea66d083bba3877bc0409b8b43a7da21f7 Mon Sep 17 00:00:00 2001 From: Apoorv Mittal Date: Thu, 23 Jul 2026 10:13:21 +0530 Subject: [PATCH 4/4] fix: the path in multiform params normalized first --- .../bruno-app/src/components/RequestPane/FileBody/index.js | 3 ++- .../src/components/RequestPane/MultipartFormParams/index.js | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/packages/bruno-app/src/components/RequestPane/FileBody/index.js b/packages/bruno-app/src/components/RequestPane/FileBody/index.js index 6929799f0b8..3c99ad7b928 100644 --- a/packages/bruno-app/src/components/RequestPane/FileBody/index.js +++ b/packages/bruno-app/src/components/RequestPane/FileBody/index.js @@ -9,6 +9,7 @@ import StyledWrapper from './StyledWrapper'; import FilePickerEditor from 'components/FilePickerEditor/index'; import SingleLineEditor from 'components/SingleLineEditor/index'; import MultiLineEditor from 'components/MultiLineEditor'; +import { normalizePath } from 'utils/common/path'; const FileBody = ({ item, collection }) => { const dispatch = useDispatch(); @@ -31,7 +32,7 @@ const FileBody = ({ item, collection }) => { const param = cloneDeep(_param); switch (type) { case 'filePath': { - param.filePath = e.target.filePath; + param.filePath = normalizePath(e.target.filePath); param.contentType = ''; break; } diff --git a/packages/bruno-app/src/components/RequestPane/MultipartFormParams/index.js b/packages/bruno-app/src/components/RequestPane/MultipartFormParams/index.js index 0f7cd4d3596..24cc9049023 100644 --- a/packages/bruno-app/src/components/RequestPane/MultipartFormParams/index.js +++ b/packages/bruno-app/src/components/RequestPane/MultipartFormParams/index.js @@ -68,7 +68,7 @@ const MultipartFormParams = ({ item, collection }) => { if (!Array.isArray(filePaths) || filePaths.length === 0) return; const processedPaths = filePaths.map((filePath) => { - return getRelativePathWithinBasePath(collection.pathname, filePath); + return getRelativePathWithinBasePath(collection.pathname, filePath, true); }); const currentParams = item.draft