Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 5fad8a7

Browse files
committed
WIP
1 parent 8757139 commit 5fad8a7

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

lib/handler/cache-revalidation-handler.js

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,6 @@ class CacheRevalidationHandler extends DecoratorHandler {
6060
// https://www.rfc-editor.org/rfc/rfc9111.html#name-handling-a-validation-respo
6161
if (statusCode === 304) {
6262
this.#successful = true
63-
this.#successCallback()
6463
return true
6564
}
6665

@@ -72,7 +71,8 @@ class CacheRevalidationHandler extends DecoratorHandler {
7271
statusMessage
7372
)
7473
}
75-
return false
74+
75+
return true
7676
}
7777

7878
/**
@@ -90,7 +90,7 @@ class CacheRevalidationHandler extends DecoratorHandler {
9090
return this.#handler.onData(chunk)
9191
}
9292

93-
return false
93+
return true
9494
}
9595

9696
/**
@@ -99,7 +99,9 @@ class CacheRevalidationHandler extends DecoratorHandler {
9999
* @param {string[] | null} rawTrailers
100100
*/
101101
onComplete (rawTrailers) {
102-
if (!this.#successful && typeof this.#handler.onComplete === 'function') {
102+
if (this.#successful) {
103+
this.#successCallback()
104+
} else if (typeof this.#handler.onComplete === 'function') {
103105
this.#handler.onComplete(rawTrailers)
104106
}
105107
}

0 commit comments

Comments
 (0)