feat: Implement secure static file serving with path traversal protection and XSS prevention for template titles.
This commit is contained in:
@@ -1,15 +1,18 @@
|
||||
import { escapeHtml } from "../utils/html";
|
||||
|
||||
interface LayoutProps {
|
||||
title: string;
|
||||
content: string;
|
||||
}
|
||||
|
||||
export function BaseLayout({ title, content }: LayoutProps): string {
|
||||
const safeTitle = escapeHtml(title);
|
||||
return `<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>${title} | Aurora</title>
|
||||
<title>${safeTitle} | Aurora</title>
|
||||
<link rel="stylesheet" href="/style.css">
|
||||
<meta name="description" content="Aurora Bot Web Interface">
|
||||
</head>
|
||||
|
||||
Reference in New Issue
Block a user