MCPcopy Create free account
hub / github.com/chartbrew/chartbrew / normalizeMimeType

Function normalizeMimeType

server/modules/logoUploadSecurity.js:15–20  ·  view source on GitHub ↗
(mimeType = "")

Source from the content-addressed store, hash-verified

13});
14
15const normalizeMimeType = (mimeType = "") => {
16 const normalized = `${mimeType}`.toLowerCase().trim();
17 if (normalized === "image/jpg") return "image/jpeg";
18 if (normalized === "application/svg+xml") return "image/svg+xml";
19 return normalized;
20};
21
22const isSafeSvgBuffer = (buffer) => {
23 if (!Buffer.isBuffer(buffer) || buffer.length === 0) {

Callers 3

isAllowedLogoMimeTypeFunction · 0.85
isValidLogoImageBufferFunction · 0.85
buildSafeLogoFilenameFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected