What if you added a ` || contentType.indexOf( "application/octet-stream" ) === 0 ` here as a one-line fix?