(buffer, mimeType)
| 98 | }; |
| 99 | |
| 100 | const isValidLogoImageBuffer = (buffer, mimeType) => { |
| 101 | const normalizedMimeType = normalizeMimeType(mimeType); |
| 102 | if (!isAllowedLogoMimeType(normalizedMimeType)) { |
| 103 | return false; |
| 104 | } |
| 105 | |
| 106 | if (normalizedMimeType === "image/svg+xml") { |
| 107 | return isSafeSvgBuffer(buffer); |
| 108 | } |
| 109 | |
| 110 | const detectedMimeType = getImageTypeFromBuffer(buffer); |
| 111 | return detectedMimeType === normalizedMimeType; |
| 112 | }; |
| 113 | |
| 114 | const buildSafeLogoFilename = (mimeType, idGenerator) => { |
| 115 | const normalizedMimeType = normalizeMimeType(mimeType); |
no test coverage detected