Problem
The default 404 handler is Go's built-in http.NotFound(), which returns a plain text "404 page not found" response for unrecognized paths on the CDN node.
Location: internal/server/server.go:334
Current Code
Proposed Fix
Create a simple HTML 404 page consistent with the existing design language (using the same layout template or a standalone page):
func render404(w http.ResponseWriter, r *http.Request) {
w.Header().Set("Content-Type", "text/html; charset=utf-8")
w.WriteHeader(http.StatusNotFound)
// Render a simple 404 page using templ or inline HTML
}
Or add a templ component:
templ notFound() {
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>404 - Not Found</title>
</head>
<body>
<main>
<h1>404</h1>
<p>This path doesn't exist on this node.</p>
<p><a href="/">Back to hubCDN</a></p>
</main>
</body>
</html>
}
Why This Matters
A plain text 404 is jarring and unprofessional. A styled 404 page maintains brand consistency and can guide users back to the landing page.
Problem
The default 404 handler is Go's built-in
http.NotFound(), which returns a plain text "404 page not found" response for unrecognized paths on the CDN node.Location:
internal/server/server.go:334Current Code
Proposed Fix
Create a simple HTML 404 page consistent with the existing design language (using the same layout template or a standalone page):
Or add a templ component:
Why This Matters
A plain text 404 is jarring and unprofessional. A styled 404 page maintains brand consistency and can guide users back to the landing page.