mirror of
https://github.com/mickael-kerjean/filestash.git
synced 2026-10-19 16:14:39 +00:00
chore (refactoring): migrate webdav to pkg/share
This commit is contained in:
@@ -59,6 +59,8 @@ var (
|
||||
ShareDelete = share.ShareDeleteHandler
|
||||
ShareUpsert = share.ShareUpsertHandler
|
||||
ShareVerifyProof = share.ShareVerifyProofHandler
|
||||
WebdavHandler = share.WebdavHandler
|
||||
WebdavBlacklist = share.WebdavBlacklist
|
||||
)
|
||||
|
||||
// frontend
|
||||
|
||||
@@ -1,13 +1,15 @@
|
||||
package ctrl
|
||||
package share
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
"path/filepath"
|
||||
"strings"
|
||||
|
||||
. "github.com/mickael-kerjean/filestash/server/common"
|
||||
"github.com/mickael-kerjean/filestash/server/model"
|
||||
. "github.com/mickael-kerjean/filestash/server/pkg/core"
|
||||
. "github.com/mickael-kerjean/filestash/server/pkg/kernel"
|
||||
"github.com/mickael-kerjean/filestash/server/pkg/permissions"
|
||||
. "github.com/mickael-kerjean/filestash/server/pkg/utils"
|
||||
|
||||
"github.com/mickael-kerjean/net/webdav"
|
||||
)
|
||||
|
||||
@@ -54,8 +56,8 @@ func WebdavHandler(ctx *App, res http.ResponseWriter, req *http.Request) {
|
||||
|
||||
h := &webdav.Handler{
|
||||
Prefix: "/s/" + ctx.Share.Id,
|
||||
FileSystem: model.NewWebdavFs(ctx.Backend, ctx.Share.Backend, ctx.Share.Path, req),
|
||||
LockSystem: model.NewWebdavLock(),
|
||||
FileSystem: NewWebdavFs(ctx.Backend, ctx.Share.Backend, ctx.Share.Path, req),
|
||||
LockSystem: NewWebdavLock(),
|
||||
}
|
||||
h.ServeHTTP(res, req)
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
package model
|
||||
package share
|
||||
|
||||
/*
|
||||
* Implementation of a webdav.FileSystem: https://godoc.org/golang.org/x/net/webdav#FileSystem that is used
|
||||
@@ -17,7 +17,10 @@ import (
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
. "github.com/mickael-kerjean/filestash/server/common"
|
||||
. "github.com/mickael-kerjean/filestash/server/pkg/core"
|
||||
. "github.com/mickael-kerjean/filestash/server/pkg/env"
|
||||
. "github.com/mickael-kerjean/filestash/server/pkg/utils"
|
||||
|
||||
"github.com/mickael-kerjean/net/webdav"
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user