Image CDN for atproto built on cloudflare

allow extensions on end of urls

evan.jarrett.net a23ba547 5701bd8c

verified
Changed files
+7 -1
src
+7 -1
src/index.ts
··· 210 210 } 211 211 212 212 const url = new URL(request.url); 213 - const [handle, base62OrCid] = url.pathname.split('/').filter(Boolean); 213 + let [handle, base62OrCid] = url.pathname.split('/').filter(Boolean); 214 214 215 215 if (!handle || !base62OrCid) { 216 216 return new Response('Invalid path. Expected: /{handle}/{cid}', { status: 400 }); ··· 248 248 ? `did:${cachedDid}` 249 249 : `did:plc:${cachedDid}`; 250 250 } 251 + } 252 + 253 + // ignore extensions on CID during lookup 254 + const match = base62OrCid.match(/^([^.@]+)/); 255 + if (match) { 256 + base62OrCid = match[1]; 251 257 } 252 258 253 259 // CID handling - expect bafkrei* format