Skip to content

Commit

Permalink
Fix comments
Browse files Browse the repository at this point in the history
  • Loading branch information
RooRay authored May 24, 2024
1 parent c13624d commit 68071f4
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions worker.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
// Read github.com/RooRay/B2Worker for setup instructions

export async function handleFile(event) {
const url = new URL(event.request.url);
const cache = caches.default;
let response = await cache.match(event.request);
let contentType = 'application/octet-stream'; // Default content type

if (!response) {
// Replace this URL with your friendly URL as per the instructions
response = await fetch(`https://f003.backblazeb2.com/file/RooImg${url.pathname}`);
const headers = { "cache-control": "public, max-age=14400" };

Expand Down

0 comments on commit 68071f4

Please sign in to comment.