fix(core): update

This commit is contained in:
Philipp Kunz 2023-04-19 14:24:43 +02:00
parent fe50adb1ff
commit 8e7c730d86
2 changed files with 3 additions and 2 deletions

View File

@ -3,6 +3,6 @@
*/
export const commitinfo = {
name: '@pushrocks/smartrequest',
version: '2.0.13',
version: '2.0.14',
description: 'dropin replacement for request'
}

View File

@ -209,10 +209,11 @@ export let request = async (
};
export const safeGet = async (urlArg: string) => {
const agentToUse = urlArg.startsWith('http') ? plugins.http.globalAgent : plugins.https.globalAgent;
try {
const response = await request(urlArg, {
method: 'GET',
agent: plugins.http.globalAgent,
agent: agentToUse,
timeout: 5000,
autoJsonParse: false,
});