From a71b8e024ad8a16a61b3e00f879805bd50ed508a Mon Sep 17 00:00:00 2001 From: Elijah Date: Tue, 26 May 2026 13:39:03 -0700 Subject: [PATCH] fix: resolve duplicate webdav route definition --- backend/main.go | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/backend/main.go b/backend/main.go index 2db571c..b7f608f 100644 --- a/backend/main.go +++ b/backend/main.go @@ -65,9 +65,6 @@ func main() { tusHandler := handlers.NewTusHandler(db, cfg) // WebDAV Handler webdavHandler := handlers.NewWebDAVHandler(db, cfg, guard) - - // Add WebDAV routes - app.All("/webdav/*", guard.Check(), webdavHandler.Handle) archiveHandler := &handlers.ArchiveHandler{DB: db, Config: cfg} shareGuard := middleware.NewBruteForceGuard(3, 60) shareHandler := &handlers.ShareHandler{DB: db, Config: cfg, Guard: shareGuard} @@ -198,6 +195,8 @@ func main() { protected.Post("/onlyoffice/template", onlyOfficeHandler.CreateFromTemplate) protected.Post("/onlyoffice/sign", onlyOfficeHandler.SignConfig) protected.Get("/onlyoffice/files", onlyOfficeHandler.ListOfficeFiles) + + protected.Get("/files/folders-tree", fsHandler.GetFolderTree) @@ -232,7 +231,7 @@ func main() { // WebDAV Endpoint (accepts basic auth OR bearer) // We use All() because WebDAV uses custom HTTP methods (PROPFIND, MKCOL, LOCK, etc.) - app.All("/webdav/*", webdavHandler.Handle) + app.All("/webdav/*", guard.Check(), webdavHandler.Handle) // Start server addr := fmt.Sprintf(":%s", cfg.Port)