tinny-backend 1.0.4 → 1.0.6

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.
@@ -219,16 +219,20 @@ export default class Server {
219
219
  });
220
220
  this.server = http.createServer((req, res) => {
221
221
  let body = "";
222
+ const rawChunks = [];
222
223
  this.reqCount++;
223
224
  const Req = RequestParser(req, this);
224
225
  const Res = ResponseParser(res, Req, this);
225
226
  req.on("data", (chunk) => {
226
227
  body += chunk.toString();
228
+ rawChunks.push(chunk);
227
229
  });
228
230
  req.on("end", async () => {
231
+ Req.RawBody = Buffer.concat(rawChunks);
229
232
  if (req.headers["content-type"] === "application/json") {
230
233
  Req.body = body ? JSON.parse(body) : null;
231
234
  }
235
+ Req.body = body;
232
236
  body = "";
233
237
  let handlersCount = 0;
234
238
  for (let i = 0; i < this.methodHandler.length; i++) {
@@ -33,6 +33,7 @@ export type ServerReq = http.IncomingMessage & {
33
33
  Query: URLSearchParams;
34
34
  queries: object;
35
35
  body?: any;
36
+ RawBody: Buffer;
36
37
  ip: string;
37
38
  server: Server;
38
39
  params: Record<string, string>;
@@ -1 +1 @@
1
- export declare const VERSION = "1.0.4";
1
+ export declare const VERSION = "1.0.6";
@@ -1 +1 @@
1
- export const VERSION = "1.0.4";
1
+ export const VERSION = "1.0.6";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tinny-backend",
3
- "version": "1.0.4",
3
+ "version": "1.0.6",
4
4
  "description": "A lightweight and flexible backend framework built on Node.js.",
5
5
  "license": "MIT",
6
6
  "author": {