File tree Expand file tree Collapse file tree 1 file changed +23
-0
lines changed
Expand file tree Collapse file tree 1 file changed +23
-0
lines changed Original file line number Diff line number Diff line change @@ -2102,4 +2102,27 @@ export class BitGoAPI implements BitGoBase {
21022102 // use defaultConstants as the backup for keys that are not set in this._constants
21032103 return _ . merge ( { } , defaultConstants ( this . getEnv ( ) ) , BitGoAPI . _constants [ this . getEnv ( ) ] ) ;
21042104 }
2105+
2106+ /**
2107+ * Execute an asset request which does not need HMAC validation
2108+ * @param url The URL for the asset request
2109+ * @returns {Promise<any> } The response body
2110+ */
2111+ protected async executeAssetRequest ( url : string ) : Promise < any > {
2112+ const req = this . getAgentRequest ( 'get' , url ) ;
2113+ req . set ( 'BitGo-SDK-Version' , this . _version ) ;
2114+ if ( this . _customProxyAgent ) {
2115+ req . agent ( this . _customProxyAgent ) ;
2116+ }
2117+ // Set the request timeout to just above 5 minutes by default
2118+ req . timeout ( ( process . env . BITGO_TIMEOUT as any ) * 1000 || 305 * 1000 ) ;
2119+ if ( this . getAdditionalHeadersCb ) {
2120+ const additionalHeaders = this . getAdditionalHeadersCb ( 'get' , url ) ;
2121+ for ( const { key, value } of additionalHeaders ) {
2122+ req . set ( key , value ) ;
2123+ }
2124+ }
2125+ const result = await req ;
2126+ return result . body ;
2127+ }
21052128}
You can’t perform that action at this time.
0 commit comments