Skip to content

Commit

Permalink
made reponse handle form data i think
Browse files Browse the repository at this point in the history
  • Loading branch information
RedMan13 committed Aug 1, 2023
1 parent fb8e03a commit b8dad05
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions extensions/godslayerakp/http.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit b8dad05

Please sign in to comment.