This commit is contained in:
2026-07-13 18:01:39 -03:00
parent dab8b09f0c
commit a345e70e5a
33 changed files with 3741 additions and 589 deletions
+15
View File
@@ -2,6 +2,7 @@ package main
import (
"fmt"
"log"
"net/http"
"os"
"path/filepath"
@@ -10,6 +11,20 @@ import (
const maxAdminRequestBody = 8 << 20
func writeInternalError(w http.ResponseWriter, operation string, err error) {
if err != nil {
log.Printf("%s: %v", operation, err)
}
http.Error(w, "internal server error", http.StatusInternalServerError)
}
func writeBadGatewayError(w http.ResponseWriter, operation string, err error) {
if err != nil {
log.Printf("%s: %v", operation, err)
}
http.Error(w, "managed server request failed", http.StatusBadGateway)
}
// securePanelHandler applies baseline browser protections and a global request
// body ceiling. Endpoint-specific handlers may impose a smaller limit.
func securePanelHandler(next http.Handler) http.Handler {