ultimate-express 2.0.4 → 2.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.
- package/package.json +1 -1
- package/src/router.js +5 -1
package/package.json
CHANGED
package/src/router.js
CHANGED
|
@@ -270,7 +270,7 @@ module.exports = class Router extends EventEmitter {
|
|
|
270
270
|
err.code = 'ECONNRESET';
|
|
271
271
|
response.aborted = true;
|
|
272
272
|
response.finished = true;
|
|
273
|
-
response.socket
|
|
273
|
+
response.socket?.emit('error', err);
|
|
274
274
|
});
|
|
275
275
|
|
|
276
276
|
return { request, response };
|
|
@@ -543,6 +543,10 @@ module.exports = class Router extends EventEmitter {
|
|
|
543
543
|
req._errorKey = route.routeKey;
|
|
544
544
|
}
|
|
545
545
|
if(routed) return resolve(true);
|
|
546
|
+
else if(req._isOptions && req._matchedMethods.size) {
|
|
547
|
+
// OPTIONS routing is different, it stops in the router if matched
|
|
548
|
+
return resolve(false);
|
|
549
|
+
}
|
|
546
550
|
next();
|
|
547
551
|
} else {
|
|
548
552
|
// handle errors and error handlers
|