Skip to content

Commit

Permalink
fix error
Browse files Browse the repository at this point in the history
  • Loading branch information
kmsec committed May 22, 2024
1 parent 1477255 commit 6c9894d
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -189,18 +189,16 @@ async function router(request: Request, ctx: ExecutionContext): Promise<Response
}
})
}
// Try cache response, the cache key is the domain
// Try cache response, the cache key is the URL.
const cache = caches.default;

let response = await cache.match(request.url.toLowerCase())

if (!response) {

response = await new AADInfo(domain).aadTenantInfo()

ctx.waitUntil(cache.put(request.url.toLowerCase(), response.clone()))
} else {
response.headers.append("X-Cache-Hit", "true")
}
return response
case '/robots.txt':
Expand Down

0 comments on commit 6c9894d

Please sign in to comment.