fix: resolve duplicate webdav route definition
All checks were successful
Automated Container Build / build-and-push (push) Successful in 56s
All checks were successful
Automated Container Build / build-and-push (push) Successful in 56s
This commit is contained in:
parent
f69c6d825e
commit
a71b8e024a
1 changed files with 3 additions and 4 deletions
|
|
@ -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)
|
||||||
|
|
|
||||||
Reference in a new issue