mirror of
https://github.com/usebruno/bruno.git
synced 2026-07-02 00:54:09 +00:00
fix: Allow to set custom user agent (#3146)
Co-authored-by: Linhart Lukáš <Lukas.Linhart@tescosw.cz>
This commit is contained in:
@@ -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;
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user