fix: resolve duplicate webdav route definition
All checks were successful
Automated Container Build / build-and-push (push) Successful in 56s

This commit is contained in:
Elijah 2026-05-26 13:39:03 -07:00
parent f69c6d825e
commit a71b8e024a

View file

@ -65,9 +65,6 @@ func main() {
tusHandler := handlers.NewTusHandler(db, cfg) tusHandler := handlers.NewTusHandler(db, cfg)
// WebDAV Handler // WebDAV Handler
webdavHandler := handlers.NewWebDAVHandler(db, cfg, guard) webdavHandler := handlers.NewWebDAVHandler(db, cfg, guard)
// Add WebDAV routes
app.All("/webdav/*", guard.Check(), webdavHandler.Handle)
archiveHandler := &handlers.ArchiveHandler{DB: db, Config: cfg} archiveHandler := &handlers.ArchiveHandler{DB: db, Config: cfg}
shareGuard := middleware.NewBruteForceGuard(3, 60) shareGuard := middleware.NewBruteForceGuard(3, 60)
shareHandler := &handlers.ShareHandler{DB: db, Config: cfg, Guard: shareGuard} shareHandler := &handlers.ShareHandler{DB: db, Config: cfg, Guard: shareGuard}
@ -199,6 +196,8 @@ func main() {
protected.Post("/onlyoffice/sign", onlyOfficeHandler.SignConfig) protected.Post("/onlyoffice/sign", onlyOfficeHandler.SignConfig)
protected.Get("/onlyoffice/files", onlyOfficeHandler.ListOfficeFiles) protected.Get("/onlyoffice/files", onlyOfficeHandler.ListOfficeFiles)
protected.Get("/files/folders-tree", fsHandler.GetFolderTree) protected.Get("/files/folders-tree", fsHandler.GetFolderTree)
// File listing and download (with path jail) // File listing and download (with path jail)
@ -232,7 +231,7 @@ func main() {
// WebDAV Endpoint (accepts basic auth OR bearer) // WebDAV Endpoint (accepts basic auth OR bearer)
// We use All() because WebDAV uses custom HTTP methods (PROPFIND, MKCOL, LOCK, etc.) // 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 // Start server
addr := fmt.Sprintf(":%s", cfg.Port) addr := fmt.Sprintf(":%s", cfg.Port)