From 9ca89f55097d11b6e9173cd8434b736545c3b645 Mon Sep 17 00:00:00 2001 From: Carl Pearson Date: Sat, 7 Sep 2024 06:07:58 -0600 Subject: [PATCH] Put /downloads behind auth --- main.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/main.go b/main.go index 5c75933..4548d73 100644 --- a/main.go +++ b/main.go @@ -93,7 +93,12 @@ func main() { e.POST("/video/:id/cancel", videoCancelHandler, authMiddleware) e.POST("/video/:id/restart", videoRestartHandler, authMiddleware) e.POST("/video/:id/delete", videoDeleteHandler, authMiddleware) - e.Static("/downloads", getDownloadDir()) + + staticGroup := e.Group("/downloads") + staticGroup.Use(authMiddleware) + staticGroup.Static("/", getDownloadDir()) + + // e.Static("/downloads", getDownloadDir()) store.Options = &sessions.Options{ Path: "/",