MCPcopy Index your code
hub / github.com/CapSoftware/Cap / contentTypeForSubpath

Function contentTypeForSubpath

apps/web/app/api/upload/[...route]/signed.ts:21–31  ·  view source on GitHub ↗
(subpath: string)

Source from the content-addressed store, hash-verified

19 decodeStorageVideo(video);
20
21function contentTypeForSubpath(subpath: string): string {
22 if (subpath.endsWith(".json")) return "application/json";
23 if (subpath.endsWith(".mp4") || subpath.endsWith(".m4s")) return "video/mp4";
24 if (subpath.endsWith(".jpg") || subpath.endsWith(".jpeg"))
25 return "image/jpeg";
26 if (subpath.endsWith(".png")) return "image/png";
27 if (subpath.endsWith(".aac")) return "audio/aac";
28 if (subpath.endsWith(".webm")) return "audio/webm";
29 if (subpath.endsWith(".m3u8")) return "application/x-mpegURL";
30 return "application/octet-stream";
31}
32
33export const app = new Hono().use(withAuth);
34

Callers 1

signed.tsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected