From 6fa918c6c7a40ff13ebabb3d981d10b2e4bde582 Mon Sep 17 00:00:00 2001 From: Oj Date: Wed, 16 Feb 2022 15:18:17 +0000 Subject: [PATCH] [Poly > Request] Replace deprecated querystring with URLSearchParams --- poly/request.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/poly/request.js b/poly/request.js index 602d230..9786b04 100644 --- a/poly/request.js +++ b/poly/request.js @@ -1,9 +1,8 @@ const https = require('https'); -const querystring = require("querystring"); // Generic polyfill for "request" npm package, wrapper for https const nodeReq = ({ method, url, headers, qs, timeout, body, stream }) => new Promise((resolve) => { - const fullUrl = `${url}${qs != null ? `?${querystring.stringify(qs)}` : ''}`; // With query string + const fullUrl = `${url}${qs != null ? `?${(new URLSearchParams(qs)).toString()}` : ''}`; // With query string let req; try {