File tree 2 files changed +10
-5
lines changed
bruno-electron/src/ipc/network
2 files changed +10
-5
lines changed Original file line number Diff line number Diff line change @@ -9,11 +9,14 @@ const { CLI_VERSION } = require('../constants');
9
9
*/
10
10
function makeAxiosInstance ( ) {
11
11
/** @type {axios.AxiosInstance } */
12
- const instance = axios . create ( ) ;
12
+ const instance = axios . create ( {
13
+ headers : {
14
+ "User-Agent" : `bruno-runtime/${ CLI_VERSION } `
15
+ }
16
+ } ) ;
13
17
14
18
instance . interceptors . request . use ( ( config ) => {
15
19
config . headers [ 'request-start-time' ] = Date . now ( ) ;
16
- config . headers [ 'user-agent' ] = `bruno-runtime/${ CLI_VERSION } ` ;
17
20
return config ;
18
21
} ) ;
19
22
Original file line number Diff line number Diff line change @@ -7,6 +7,7 @@ const electronApp = require("electron");
7
7
const LOCAL_IPV6 = '::1' ;
8
8
const LOCAL_IPV4 = '127.0.0.1' ;
9
9
const LOCALHOST = 'localhost' ;
10
+ const version = electronApp ?. app ?. getVersion ( ) ?. substring ( 1 ) ?? "" ;
10
11
11
12
const getTld = ( hostname ) => {
12
13
if ( ! hostname ) {
@@ -66,9 +67,11 @@ function makeAxiosInstance() {
66
67
} , this ) ;
67
68
return data ;
68
69
} ,
69
- proxy : false
70
+ proxy : false ,
71
+ headers : {
72
+ "User-Agent" : `bruno-runtime/${ version } `
73
+ }
70
74
} ) ;
71
- const version = electronApp ?. app ?. getVersion ( ) ?. substring ( 1 ) ?? "" ;
72
75
73
76
instance . interceptors . request . use ( async ( config ) => {
74
77
const url = URL . parse ( config . url ) ;
@@ -88,7 +91,6 @@ function makeAxiosInstance() {
88
91
}
89
92
90
93
config . headers [ 'request-start-time' ] = Date . now ( ) ;
91
- config . headers [ 'user-agent' ] = `bruno-runtime/${ version } ` ;
92
94
return config ;
93
95
} ) ;
94
96
You can’t perform that action at this time.
0 commit comments