Added configurable user-agent for axios

Will use `mempool/v${backendInfo.getBackendInfo().version}` for default
This commit is contained in:
Ayanami
2022-05-20 23:38:16 +09:00
parent 9d5bbf1f44
commit e41a08789a
6 changed files with 33 additions and 3 deletions

View File

@@ -55,7 +55,7 @@ class FiatConversion {
const isHTTP = (new URL(fiatConversionUrl).protocol.split(':')[0] === 'http') ? true : false;
const axiosOptions: axiosOptions = {
headers: {
'User-Agent': `mempool/v${backendInfo.getBackendInfo().version}`
'User-Agent': (config.MEMPOOL.USER_AGENT === 'mempool') ? `mempool/v${backendInfo.getBackendInfo().version}` : `${config.MEMPOOL.USER_AGENT}`
},
timeout: config.SOCKS5PROXY.ENABLED ? 30000 : 10000
};