Files
DRMDTool/src/router.go
Joren 1c82b619c4 Harden web/download pipeline and split handler modules
Replace shell-based downloader execution with validated arguments, enforce request hardening and safer defaults, and refactor handlers/router/state so job control is safer and easier to maintain.
2026-04-14 10:21:11 +02:00

20 lines
604 B
Go

package main
import "net/http"
func newRouter() http.Handler {
mux := http.NewServeMux()
mux.HandleFunc("/", handleRoot)
mux.HandleFunc("/upload", handleUpload)
mux.HandleFunc("/select", handleSelect)
mux.HandleFunc("/process", handleProcess)
mux.HandleFunc("/progress", handleProgress)
mux.HandleFunc("/abort", handleAbort)
mux.HandleFunc("/pause", handlePause)
mux.HandleFunc("/resume", handleResume)
mux.HandleFunc("/clear-completed", handleClearCompleted)
mux.HandleFunc("/ws", handleWebSocket)
mux.HandleFunc("/set-speed-limit", handleSetSpeedLimit)
return withSecurityHeaders(mux)
}