Skip to content

Commit 723fdf3

Browse files
chore(http/report): remove co-body
1 parent b701a81 commit 723fdf3

File tree

3 files changed

+6
-4
lines changed

3 files changed

+6
-4
lines changed

package.json

-1
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,6 @@
9696
"@topcli/prompts": "^1.9.0",
9797
"@topcli/spinner": "^2.1.2",
9898
"cacache": "^18.0.2",
99-
"co-body": "^6.1.0",
10099
"dotenv": "^16.4.4",
101100
"filenamify": "^6.0.0",
102101
"highlightjs-line-numbers.js": "^2.8.0",

public/components/views/home/report/report.js

+4-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,10 @@ export class PopupReport {
2424
body: JSON.stringify({
2525
title,
2626
includesAllDeps
27-
})
27+
}),
28+
headers: {
29+
"Content-Type": "application/json"
30+
}
2831
}).then(async(response) => {
2932
const { data: json } = await response.json();
3033
const url = window.URL.createObjectURL(

src/http-server/endpoints/report.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@ import fs from "node:fs";
44
// Import Third-party Dependencikes
55
import { report } from "@nodesecure/report";
66
import send from "@polka/send-type";
7-
import * as coBody from "co-body";
87

98
// Import Internal Dependencies
109
import { context } from "../context.js";
10+
import { bodyParser } from "../bodyParser.js";
1111

1212
// TODO: provide a non-file-based API on RC side ?
1313
const kReportPayload = {
@@ -46,7 +46,7 @@ const kReportPayload = {
4646
};
4747

4848
export async function post(req, res) {
49-
const body = await coBody.json(req);
49+
const body = await bodyParser(req);
5050
const { title, includesAllDeps } = body;
5151

5252
const { dataFilePath } = context.getStore();

0 commit comments

Comments
 (0)