Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
static getContentType(buffer: Buffer): string {
// the substr really shouldn't be necessary, but there's a bug somewhere that can cause buffer.slice(0,4) to return
// the entire contents of the buffer, so it's a failsafe to catch that
return contentType.fromHeader(buffer);
}