fix(core): update
This commit is contained in:
parent
fe50adb1ff
commit
8e7c730d86
@ -3,6 +3,6 @@
|
|||||||
*/
|
*/
|
||||||
export const commitinfo = {
|
export const commitinfo = {
|
||||||
name: '@pushrocks/smartrequest',
|
name: '@pushrocks/smartrequest',
|
||||||
version: '2.0.13',
|
version: '2.0.14',
|
||||||
description: 'dropin replacement for request'
|
description: 'dropin replacement for request'
|
||||||
}
|
}
|
||||||
|
@ -209,10 +209,11 @@ export let request = async (
|
|||||||
};
|
};
|
||||||
|
|
||||||
export const safeGet = async (urlArg: string) => {
|
export const safeGet = async (urlArg: string) => {
|
||||||
|
const agentToUse = urlArg.startsWith('http') ? plugins.http.globalAgent : plugins.https.globalAgent;
|
||||||
try {
|
try {
|
||||||
const response = await request(urlArg, {
|
const response = await request(urlArg, {
|
||||||
method: 'GET',
|
method: 'GET',
|
||||||
agent: plugins.http.globalAgent,
|
agent: agentToUse,
|
||||||
timeout: 5000,
|
timeout: 5000,
|
||||||
autoJsonParse: false,
|
autoJsonParse: false,
|
||||||
});
|
});
|
||||||
|
Loading…
Reference in New Issue
Block a user