export const httpStreamOutput = function(readStream, name, http, downloadFlag, cacheControl, fileObj) { const { fileNameIsBrowserExecutable, fileResponsePolicy, } = require('./fileResponseSafety'); const storedType = fileObj?.versions?.original?.type || fileObj?.type; const policy = fileResponsePolicy(storedType, fileNameIsBrowserExecutable(name)); // Sanitize known exploits from EXISTING files on the fly, straight from the // storage backend, without buffering whole files: the sanitizer sniffs the // start of the stream and only rewrites documents that begin like dangerous // markup (SVG/XML with