Socket
Socket
Sign inDemoInstall

rjweb-server

Package Overview
Dependencies
Maintainers
1
Versions
373
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

rjweb-server - npm Package Compare versions

Comparing version 9.0.4 to 9.0.5

4

CHANGELOG.md

@@ -0,1 +1,5 @@

## 9.0.5
- Do not call finish handler on aborts
## 9.0.4

@@ -2,0 +6,0 @@

2

lib/cjs/classes/Middleware.js

@@ -56,3 +56,3 @@ "use strict";

/**
* Callback that runs when any HTTP Request finishes or aborts
* Callback that runs when any HTTP Request finishes
* @since 9.0.0

@@ -59,0 +59,0 @@ */ httpRequestFinish(callback) {

{
"name": "rjweb-server",
"version": "9.0.4",
"version": "9.0.5",
"description": "Easy and Robust Way to create a Web Server with Many Easy-to-use Features in NodeJS",

@@ -5,0 +5,0 @@ "main": "./lib/cjs/index.js",

@@ -117,15 +117,17 @@ "use strict";

this.global.logger.debug(`Aborted Request on ${this.url.method} ${this.url.href}`);
for (let i = 0; i < this.middlewares.length; i++) {
const middleware = this.middlewares[i];
if (middleware.finishCallbacks.httpRequest)
if (ctr) {
for (let i = 0; i < this.middlewares.length; i++) {
const middleware = this.middlewares[i];
if (middleware.finishCallbacks.httpRequest)
try {
await Promise.resolve(middleware.finishCallbacks.httpRequest(middleware.config, this.server, this, ctr, this.elapsed()));
}
catch { }
}
if (this.global.finishHandlers.httpRequest)
try {
await Promise.resolve(middleware.finishCallbacks.httpRequest(middleware.config, this.server, this, ctr, this.elapsed()));
await Promise.resolve(this.global.finishHandlers.httpRequest(ctr, this.elapsed()));
}
catch { }
}
if (this.global.finishHandlers.httpRequest)
try {
await Promise.resolve(this.global.finishHandlers.httpRequest(ctr, this.elapsed()));
}
catch { }
this.aborted = !ctr;

@@ -132,0 +134,0 @@ return false;

@@ -50,3 +50,3 @@ import HttpRequestContext from "./request/HttpRequestContext";

/**
* Callback that runs when any HTTP Request finishes or aborts
* Callback that runs when any HTTP Request finishes
* @since 9.0.0

@@ -53,0 +53,0 @@ */ httpRequestFinish(callback) {

{
"name": "rjweb-server",
"version": "9.0.4",
"version": "9.0.5",
"description": "Easy and Robust Way to create a Web Server with Many Easy-to-use Features in NodeJS",

@@ -5,0 +5,0 @@ "main": "./lib/cjs/index.js",

@@ -112,15 +112,17 @@ import Middleware from "../../../classes/Middleware";

this.global.logger.debug(`Aborted Request on ${this.url.method} ${this.url.href}`);
for (let i = 0; i < this.middlewares.length; i++) {
const middleware = this.middlewares[i];
if (middleware.finishCallbacks.httpRequest)
if (ctr) {
for (let i = 0; i < this.middlewares.length; i++) {
const middleware = this.middlewares[i];
if (middleware.finishCallbacks.httpRequest)
try {
await Promise.resolve(middleware.finishCallbacks.httpRequest(middleware.config, this.server, this, ctr, this.elapsed()));
}
catch { }
}
if (this.global.finishHandlers.httpRequest)
try {
await Promise.resolve(middleware.finishCallbacks.httpRequest(middleware.config, this.server, this, ctr, this.elapsed()));
await Promise.resolve(this.global.finishHandlers.httpRequest(ctr, this.elapsed()));
}
catch { }
}
if (this.global.finishHandlers.httpRequest)
try {
await Promise.resolve(this.global.finishHandlers.httpRequest(ctr, this.elapsed()));
}
catch { }
this.aborted = !ctr;

@@ -127,0 +129,0 @@ return false;

@@ -68,3 +68,3 @@ import { AnyClass, EndFn, RealAny } from "../types/internal";

/**
* Callback that runs when any HTTP Request finishes or aborts
* Callback that runs when any HTTP Request finishes
* @since 9.0.0

@@ -71,0 +71,0 @@ */ httpRequestFinish(callback: (config: Config, server: Server<{}, [], {}>, context: RequestContext<InternalData>, ctr: Base, ms: number) => RealAny): Omit<Middleware<Config, InternalData, ModifiedHttpContext, ModifiedWsOpenContext, ModifiedWsMessageContext, ModifiedWsCloseContext, [...Excluded, 'httpRequestFinish']>, Excluded[number] | 'httpRequestFinish'>;

{
"name": "rjweb-server",
"version": "9.0.4",
"version": "9.0.5",
"description": "Easy and Robust Way to create a Web Server with Many Easy-to-use Features in NodeJS",

@@ -5,0 +5,0 @@ "main": "./lib/cjs/index.js",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc