some lint fixes

This commit is contained in:
ston1th 2021-11-05 22:10:52 +01:00
commit 9f4fda3c8b
11 changed files with 36 additions and 40 deletions

View file

@ -28,7 +28,7 @@ const (
)
type HTTPServer struct {
Config core.Config
Config *core.Config
listener net.Listener
srv *http.Server
@ -44,7 +44,7 @@ type HTTPServer struct {
res map[string][]byte
}
func NewHTTPServer(cfg core.Config, l net.Listener, s *scan.Scanner) (srv *HTTPServer) {
func NewHTTPServer(cfg *core.Config, l net.Listener, s *scan.Scanner) (srv *HTTPServer) {
srv = &HTTPServer{
Config: cfg,
listener: l,
@ -115,9 +115,9 @@ func (s *HTTPServer) buildRoutes() http.Handler {
r := mux.NewRouter()
r.NotFoundHandler = &notFoundHandler{s}
if s.Config.WebDav {
fs := authdav.NewWriteOnlyOnceFileSystem(webdav.Dir(s.Config.DataDir))
fs.Filters = []authdav.Filter{authdav.NewMacOSFilter()}
h := authdav.NewWebdavBasicAuth(core.WebDavPrefix, fs, nil, webdavLogger, s.DB, "DocStore WebDav")
dav := authdav.NewWriteOnlyOnceFileSystem(webdav.Dir(s.Config.DataDir))
dav.Filters = []authdav.Filter{authdav.NewMacOSFilter()}
h := authdav.NewWebdavBasicAuth(core.WebDavPrefix, dav, nil, webdavLogger, s.DB, "DocStore WebDav")
r.PathPrefix(core.WebDavPrefix).Handler(h)
}
r.Handle("/static/{file}", http.StripPrefix("/", http.FileServer(http.FS(static))))