godprotocol 2.2.83 → 2.2.84
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import parseMultipart from "godprotocol/server/parse_multipart_data.js";
|
|
1
2
|
import serveStaticFile from "godprotocol/server/serve_static_file.js";
|
|
2
3
|
|
|
3
4
|
const getBody = (req) => {
|
|
@@ -131,8 +132,14 @@ const version_middleware = async (req, res, routers) => {
|
|
|
131
132
|
|
|
132
133
|
body = Object.fromEntries(url.searchParams.entries());
|
|
133
134
|
} else {
|
|
134
|
-
|
|
135
|
-
|
|
135
|
+
const contentType = req.headers["content-type"] || "";
|
|
136
|
+
|
|
137
|
+
if (contentType.includes("multipart/form-data")) {
|
|
138
|
+
body = await parseMultipart(req, routers.gp);
|
|
139
|
+
} else {
|
|
140
|
+
error_stage = "Body Parser";
|
|
141
|
+
body = await getBody(req);
|
|
142
|
+
}
|
|
136
143
|
}
|
|
137
144
|
|
|
138
145
|
if (versionRouter.config?.is_old) {
|