diff --git a/packages/bruno-cli/src/utils/axios-instance.js b/packages/bruno-cli/src/utils/axios-instance.js index af96806eb..8f61066c5 100644 --- a/packages/bruno-cli/src/utils/axios-instance.js +++ b/packages/bruno-cli/src/utils/axios-instance.js @@ -9,11 +9,14 @@ const { CLI_VERSION } = require('../constants'); */ function makeAxiosInstance() { /** @type {axios.AxiosInstance} */ - const instance = axios.create(); + const instance = axios.create({ + headers: { + "User-Agent": `bruno-runtime/${CLI_VERSION}` + } + }); instance.interceptors.request.use((config) => { config.headers['request-start-time'] = Date.now(); - config.headers['user-agent'] = `bruno-runtime/${CLI_VERSION}`; return config; }); diff --git a/packages/bruno-electron/src/ipc/network/axios-instance.js b/packages/bruno-electron/src/ipc/network/axios-instance.js index d5208ceac..4f7f9f8f6 100644 --- a/packages/bruno-electron/src/ipc/network/axios-instance.js +++ b/packages/bruno-electron/src/ipc/network/axios-instance.js @@ -7,6 +7,7 @@ const electronApp = require("electron"); const LOCAL_IPV6 = '::1'; const LOCAL_IPV4 = '127.0.0.1'; const LOCALHOST = 'localhost'; +const version = electronApp?.app?.getVersion()?.substring(1) ?? ""; const getTld = (hostname) => { if (!hostname) { @@ -66,9 +67,11 @@ function makeAxiosInstance() { }, this); return data; }, - proxy: false + proxy: false, + headers: { + "User-Agent": `bruno-runtime/${version}` + } }); - const version = electronApp?.app?.getVersion()?.substring(1) ?? ""; instance.interceptors.request.use(async (config) => { const url = URL.parse(config.url); @@ -88,7 +91,6 @@ function makeAxiosInstance() { } config.headers['request-start-time'] = Date.now(); - config.headers['user-agent'] = `bruno-runtime/${version}`; return config; });