gitflarePublicPartly agent-ready50
cf-r2-drop
Drag-and-drop file sharing on Cloudflare R2: multipart uploads, expiring share links, previews, download counts, lifecycle expiry.
- LicenseApache-2.0
- LanguageTypeScript
- Last landed
0e4544fOct 20, 2026
Serve the share page from the extensionless asset path
0e4544fimport { it, expect, vi } from "vitest";vi.mock("cloudflare:workers", () => ({ DurableObject: class {} }));import worker from "../src/index"; it("never requests .html from ASSETS for pretty routes", async () => { const seen: string[] = []; const env: any = { ASSETS: { fetch: async (r: Request) => { seen.push(new URL(r.url).pathname); return new Response("shell"); } } }; const res = await (worker.fetch as any)(new Request("https://x.test/s/abc.def"), env); expect(res.status).toBe(200); expect(seen).toEqual(["/share"]); expect(seen.some((p) => p.endsWith(".html"))).toBe(false);});