fixing sec issues
Some checks failed
CloudSave/pipeline/head There was a failure building this commit

This commit is contained in:
2025-09-07 01:14:19 +02:00
parent b3232e79d5
commit af11e843a4
13 changed files with 88 additions and 37 deletions

View File

@@ -74,8 +74,9 @@ func NewServer(documentRoot string, srv *data.Service, creds map[string]string,
})
})
s.Server = &http.Server{
Addr: fmt.Sprintf(":%d", port),
Handler: router,
Addr: fmt.Sprintf(":%d", port),
Handler: router,
ReadHeaderTimeout: 2,
}
return s
}

View File

@@ -66,7 +66,9 @@ func run(updateChan <-chan struct{}) {
for {
<-updateChan
if r, ok := repo.(*repository.EagerRepository); ok {
r.Reload()
if err := r.Reload(); err != nil {
fatal("failed to reload data: "+err.Error(), 1)
}
}
h, err := htpasswd.Open(filepath.Join(documentRoot, ".htpasswd"))
if err != nil {