From b8dad05b800c3e839e9e69e0b785defa4b315b09 Mon Sep 17 00:00:00 2001 From: RedMan13 Date: Mon, 31 Jul 2023 17:33:34 -0700 Subject: [PATCH] made reponse handle form data i think --- extensions/godslayerakp/http.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/extensions/godslayerakp/http.js b/extensions/godslayerakp/http.js index a308b1f9fb..7e14d4a03f 100644 --- a/extensions/godslayerakp/http.js +++ b/extensions/godslayerakp/http.js @@ -686,6 +686,15 @@ this.request.events.activate('reqFail'); } this.request.end = true; + if (res.headers.get('Content-Type') === 'multipart/form-data') { + const form = await res.formData(); + const json = {}; + for (const [key, value] of form.entries()) { + json[key] = value; + } + this.response.text = JSON.stringify(json); + return; + } const body = await res.text(); this.response.text = body; } catch (err) {