INNER CODE UNIT · TypeScript
hardenPodLogsProxyResponse
kubeflow/pipelines · frontend/server/app.ts:42
function hardenPodLogsProxyResponse(proxyRes: IncomingMessage): void {
proxyRes.headers['x-content-type-options'] = 'nosniff';
proxyRes.headers['content-disposition'] = 'attachment';
proxyRes.headers['content-type'] = 'text/plain; charset=utf-8';
}
const hardenPodLogsProxyRequest: express.Handler = (_req, res, next) => {
res.setHeader('X-Content-Type-Options', 'nosniff');
res.setHeader('Content-Disposition', 'attachment');
res.type('text/plain');
next();
};
function getRegisterHandler(app: Application, basePath: string) {
return (
func: (name: string | string[], handler: express.Handler) => express.Application,
route: string | string[],
handler: express.Handler,