mirror of
https://github.com/yusing/godoxy.git
synced 2026-03-20 16:44:27 +01:00
v0.5.0-rc4: fixing autocert issue, cache ACME registration, added ls-config option
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user