my personal site
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

Update routing and asset handling for privacy page

- Added "/privacy*" to the run_worker_first routes in wrangler.jsonc for improved asset fetching.
- Updated the asset request URL in index.ts to remove the file extension, aligning with the new privacy policy structure.

+1 -20
+1
gymtracker/public/privacy.html
··· 1 + docs/privacy-policy.html
-20
gymtracker/src/index.ts
··· 494 494 }); 495 495 } 496 496 497 - if (url.pathname === "/privacy" || url.pathname === "/privacy/") { 498 - const assetRequest = new Request( 499 - new URL("/docs/privacy-policy.html", url.origin).href, 500 - request 501 - ); 502 - const res = await env.ASSETS.fetch(assetRequest); 503 - if (res.status === 404) { 504 - return jsonResponse({ error: "Not found" }, 404, request); 505 - } 506 - return new Response(res.body, { 507 - status: res.status, 508 - headers: { 509 - "Content-Type": "text/html; charset=utf-8", 510 - "Cache-Control": isLocalRequest(request) 511 - ? "no-store, no-cache, must-revalidate" 512 - : "public, max-age=3600", 513 - }, 514 - }); 515 - } 516 - 517 497 if (url.pathname === "/ads" || url.pathname === "/ads/") { 518 498 return new Response(getAdsLandingHtml(), { 519 499 headers: {