MCPcopy
hub / github.com/CaviraOSS/OpenMemory / getContentType

Function getContentType

backend/src/server/server.js:141–157  ·  view source on GitHub ↗
(a)

Source from the content-addressed store, hash-verified

139 });
140 };
141 function getContentType(a) {
142 switch (path.extname(a).toLowerCase()) {
143 case '.html': return 'text/html';
144 case '.js': return 'text/javascript';
145 case '.css': return 'text/css';
146 case '.json': return 'application/json';
147 case '.txt': return 'text/plain';
148 case '.ico': return 'image/x-icon';
149 case '.png': return 'image/png';
150 case '.webp': return 'image/webp';
151 case '.jpg': return 'image/jpeg';
152 case '.jpeg': return 'image/jpeg';
153 case '.gif': return 'image/gif';
154 case '.svg': return 'image/svg+xml';
155 default: return 'application/octet-stream';
156 }
157 }
158 };
159 use((req, res, next) => {
160 if (req.headers['content-type']?.includes('application/json')) {

Callers 1

serverStaticFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected