Skip to content

Commit

Permalink
fix type lint
Browse files Browse the repository at this point in the history
Signed-off-by: oilbeater <[email protected]>
  • Loading branch information
oilbeater committed Oct 3, 2024
1 parent 8ab41de commit 31717c8
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/middlewares/cache.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ export const cacheMiddleware: MiddlewareHandler = async (c: Context<AppContext>,
const cacheKeyHex = await generateCacheKey(c.req.url, await c.req.text());
const response = await c.env.MALACCA_CACHE.get(cacheKeyHex, "stream");
if (response) {
const { _, metadata } = await c.env.MALACCA_CACHE.getWithMetadata(cacheKeyHex, "stream");
const contentType = metadata['contentType'] || 'application/octet-stream';
const { value: _value, metadata } = await c.env.MALACCA_CACHE.getWithMetadata(cacheKeyHex, "stream");
const contentType = (metadata as Record<string, string>)['contentType'] || 'application/octet-stream';
c.set('malacca-cache-status', 'hit');
return new Response(response, { headers: { 'malacca-cache-status': 'hit', 'content-type': contentType } });
}
Expand Down

0 comments on commit 31717c8

Please sign in to comment.