From aa4261b70f437eb2b6d042c257a54deef7ca730e Mon Sep 17 00:00:00 2001 From: Robert Nagy Date: Wed, 6 Nov 2024 09:49:11 +0000 Subject: [PATCH] WIP --- lib/cache/memory-cache-store.js | 1 + lib/handler/cache-handler.js | 9 ++------- 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/lib/cache/memory-cache-store.js b/lib/cache/memory-cache-store.js index ae6d6614d82..bd8f6e33d97 100644 --- a/lib/cache/memory-cache-store.js +++ b/lib/cache/memory-cache-store.js @@ -294,6 +294,7 @@ class MemoryStoreReadableStream extends Readable { * @type {MemoryStoreValue} */ #value + /** * @type {Buffer[]} */ diff --git a/lib/handler/cache-handler.js b/lib/handler/cache-handler.js index 419523f7e10..b46280c1120 100644 --- a/lib/handler/cache-handler.js +++ b/lib/handler/cache-handler.js @@ -75,14 +75,9 @@ class CacheHandler extends DecoratorHandler { statusCode >= 200 && statusCode <= 399 ) { - // https://www.rfc-editor.org/rfc/rfc9111.html#name-invalidating-stored-respons - // Try/catch for if it's synchronous + // https://www.rfc-editor.org/rfc/rfc9111.html#name-invalidating-stored-response try { - const result = this.#store.deleteByOrigin(this.#requestOptions.origin) - if (typeof result?.catch === 'function') { - // Fail silently - result.catch(noop) - } + this.#store.deleteByOrigin(this.#requestOptions.origin.toString())?.catch?.(noop) } catch { // Fail silently }