ultimate-express 2.0.7 → 2.0.9

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,6 +1,6 @@
1
1
  {
2
2
  "name": "ultimate-express",
3
- "version": "2.0.7",
3
+ "version": "2.0.9",
4
4
  "description": "The Ultimate Express. Fastest http server with full Express compatibility, based on uWebSockets.",
5
5
  "main": "src/index.js",
6
6
  "scripts": {
package/src/index.js CHANGED
@@ -52,3 +52,14 @@ Application.text = middlewares.text;
52
52
  Application.raw = middlewares.raw;
53
53
 
54
54
  module.exports = Application;
55
+
56
+ // re-export some named exports for compatibility
57
+ exports.application = Application;
58
+ exports.request = Request.prototype;
59
+ exports.response = Response.prototype;
60
+ exports.Router = Router;
61
+ exports.json = middlewares.json;
62
+ exports.raw = middlewares.raw;
63
+ exports.static = middlewares.static;
64
+ exports.text = middlewares.text;
65
+ exports.urlencoded = middlewares.urlencoded;
@@ -168,7 +168,7 @@ function createBodyParser(defaultType, beforeReturn) {
168
168
 
169
169
  const type = req.headers['content-type'];
170
170
 
171
- req.body = new NullObject();
171
+ if(!req.body) req.body = new NullObject();
172
172
 
173
173
  // skip reading body for no content type
174
174
  if(!type) {