mirror of
https://github.com/usebruno/bruno.git
synced 2026-06-11 09:51:30 +00:00
fix(proxy): proxy config export from v2 to import in v3 (#8112)
* FIXED regression for proxy config from v2 to v3 * REMOVED console.log * ADDED test case with fixture to test proxy import * ADDED proxy handling for older brunoConfig in packages/bruno-electron/src/utils/collection-import.js * RESOLVED githiub converstation changed afterAll --> afterEach * ADDED guard to transformProxyConfig(brunoConfig.proxy) function
This commit is contained in:
@@ -28,6 +28,7 @@ const { cookiesStore } = require('../store/cookies');
|
||||
const { parseLargeRequestWithRedaction } = require('../utils/parse');
|
||||
const { wsClient } = require('../ipc/network/ws-event-handlers');
|
||||
const { hasSubDirectories } = require('../utils/filesystem');
|
||||
const { transformProxyConfig } = require('@usebruno/requests');
|
||||
|
||||
const {
|
||||
DEFAULT_GITIGNORE,
|
||||
@@ -1227,7 +1228,9 @@ const registerRendererEventHandlers = (mainWindow, watcher) => {
|
||||
ignore: ['node_modules', '.git']
|
||||
};
|
||||
}
|
||||
|
||||
if (brunoConfig.proxy) {
|
||||
brunoConfig.proxy = transformProxyConfig(brunoConfig.proxy);
|
||||
}
|
||||
return brunoConfig;
|
||||
};
|
||||
|
||||
@@ -2442,7 +2445,7 @@ const registerRendererEventHandlers = (mainWindow, watcher) => {
|
||||
|
||||
await fsExtra.move(collectionDir, finalCollectionPath);
|
||||
if (tempDir !== collectionDir) {
|
||||
await fsExtra.remove(tempDir).catch(() => {});
|
||||
await fsExtra.remove(tempDir).catch(() => { });
|
||||
}
|
||||
|
||||
const uid = generateUidBasedOnHash(finalCollectionPath);
|
||||
@@ -2455,7 +2458,7 @@ const registerRendererEventHandlers = (mainWindow, watcher) => {
|
||||
|
||||
return finalCollectionPath;
|
||||
} catch (error) {
|
||||
await fsExtra.remove(tempDir).catch(() => {});
|
||||
await fsExtra.remove(tempDir).catch(() => { });
|
||||
throw error;
|
||||
}
|
||||
} catch (error) {
|
||||
|
||||
@@ -4,6 +4,7 @@ const { ipcMain } = require('electron');
|
||||
const { sanitizeName, createDirectory, writeFile, safeWriteFileSync, getCollectionStats } = require('./filesystem');
|
||||
const { generateUidBasedOnHash, stringifyJson } = require('./common');
|
||||
const { stringifyRequestViaWorker, stringifyCollection, stringifyEnvironment, stringifyFolder, DEFAULT_COLLECTION_FORMAT } = require('@usebruno/filestore');
|
||||
const { transformProxyConfig } = require('@usebruno/requests/dist/cjs');
|
||||
|
||||
/**
|
||||
* Recursively find a unique folder name by appending incremental numbers
|
||||
@@ -93,6 +94,10 @@ async function importCollection(collection, collectionLocation, mainWindow, uniq
|
||||
};
|
||||
}
|
||||
|
||||
if (brunoConfig.proxy) {
|
||||
brunoConfig.proxy = transformProxyConfig(brunoConfig.proxy);
|
||||
}
|
||||
|
||||
return brunoConfig;
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user