rjweb-server
Advanced tools
Comparing version 9.0.4 to 9.0.5
@@ -0,1 +1,5 @@ | ||
## 9.0.5 | ||
- Do not call finish handler on aborts | ||
## 9.0.4 | ||
@@ -2,0 +6,0 @@ |
@@ -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", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
524329
12886