MCPcopy Create free account
hub / github.com/MoonshotAI/kimi-code / mimeType

Function mimeType

packages/server/src/routes/webAssets.ts:104–131  ·  view source on GitHub ↗
(filePath: string)

Source from the content-addressed store, hash-verified

102}
103
104function mimeType(filePath: string): string {
105 switch (extname(filePath)) {
106 case '.html':
107 return 'text/html; charset=utf-8';
108 case '.js':
109 case '.mjs':
110 return 'text/javascript; charset=utf-8';
111 case '.css':
112 return 'text/css; charset=utf-8';
113 case '.json':
114 return 'application/json; charset=utf-8';
115 case '.svg':
116 return 'image/svg+xml';
117 case '.png':
118 return 'image/png';
119 case '.jpg':
120 case '.jpeg':
121 return 'image/jpeg';
122 case '.webp':
123 return 'image/webp';
124 case '.ico':
125 return 'image/x-icon';
126 case '.woff2':
127 return 'font/woff2';
128 default:
129 return 'application/octet-stream';
130 }
131}

Callers 1

serveWebAssetFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected