v0.5.0-rc4: fixing autocert issue, cache ACME registration, added ls-config option

This commit is contained in:
yusing
2024-09-17 08:41:36 +08:00
parent 04fd6543fd
commit 82f06374f7
33 changed files with 301 additions and 221 deletions

View File

@@ -33,7 +33,7 @@ func SetFileContent(w http.ResponseWriter, r *http.Request) {
return
}
content, err := E.Check(io.ReadAll(r.Body))
if err.IsNotNil() {
if err.HasError() {
U.HandleErr(w, r, err)
return
}
@@ -44,13 +44,13 @@ func SetFileContent(w http.ResponseWriter, r *http.Request) {
err = provider.Validate(content)
}
if err.IsNotNil() {
if err.HasError() {
U.HandleErr(w, r, err, http.StatusBadRequest)
return
}
err = E.From(os.WriteFile(path.Join(common.ConfigBasePath, filename), content, 0644))
if err.IsNotNil() {
if err.HasError() {
U.HandleErr(w, r, err)
return
}

View File

@@ -8,7 +8,7 @@ import (
)
func Reload(cfg *config.Config, w http.ResponseWriter, r *http.Request) {
if err := cfg.Reload(); err.IsNotNil() {
if err := cfg.Reload(); err.HasError() {
U.HandleErr(w, r, err)
return
}