Call the onRequest hook unbound, as the session did
Mirror / push (push) Successful in 6s
Test / test (20) (pull_request) Successful in 32s
Test / test (22) (pull_request) Successful in 32s
Test / test (24) (pull_request) Successful in 32s
Test / lint (pull_request) Successful in 23s
Test / test (18) (pull_request) Successful in 31s
Test / test (26) (pull_request) Successful in 32s
Mirror / push (push) Successful in 6s
Test / test (20) (pull_request) Successful in 32s
Test / test (22) (pull_request) Successful in 32s
Test / test (24) (pull_request) Successful in 32s
Test / lint (pull_request) Successful in 23s
Test / test (18) (pull_request) Successful in 31s
Test / test (26) (pull_request) Successful in 32s
This commit is contained in:
@@ -97,8 +97,10 @@ export class IncomingRequests {
|
||||
|
||||
async handle(pduObj: PduObject): Promise<void> {
|
||||
const generation = this.linkGeneration;
|
||||
const { onRequest } = this;
|
||||
|
||||
if (this.onRequest && await this.onRequest(this.session, pduObj)) return;
|
||||
// Called unbound, so the application's hook never sees this class as its `this`.
|
||||
if (onRequest && await onRequest(this.session, pduObj)) return;
|
||||
|
||||
// The link it arrived on went while the hook ran, so nothing we answer now correlates.
|
||||
if (this.linkGeneration !== generation) {
|
||||
|
||||
Reference in New Issue
Block a user