From cf2728cf9739d5d4a21e54d983800e39215fdaaa Mon Sep 17 00:00:00 2001 From: Flummi Date: Tue, 2 May 2023 00:36:18 +0000 Subject: [PATCH] =?UTF-8?q?=E2=80=9Esrc/index.mjs=E2=80=9C=20=C3=A4ndern?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/index.mjs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/index.mjs b/src/index.mjs index 954399e..7a0bfe3 100644 --- a/src/index.mjs +++ b/src/index.mjs @@ -19,10 +19,10 @@ export default (a, options = {}, link = url.parse(a), body = "") => new Promise( if(options.method === "POST") { body = typeof options.body === "object" ? querystring.stringify(options.body) : options.body; delete options.body; - options.headers = {...options.headers, ...{ + options.headers = {...{ "Content-Type": "application/x-www-form-urlencoded", "Content-Length": Buffer.byteLength(body) - }}; + }, ...options.headers}; } (link.protocol === "https:"?https:http).request(options, res => resolve({ body: res,