diff --git a/admin/admin.go b/admin/admin.go index a76dc0b..cf53a80 100644 --- a/admin/admin.go +++ b/admin/admin.go @@ -14,6 +14,15 @@ func about(w http.ResponseWriter, r *http.Request) { } func setConfig(w http.ResponseWriter, r *http.Request) { + ctx := r.Context() + ctxData := ctx.Value(server.RequestCtxKey("ctxData")).(map[string]interface{}) + data, ok := ctxData["data"] + if !ok { + w.WriteHeader(http.StatusBadRequest) + return + } + t := data.(model.HttpServerConfig) + model.SetServerConfig(&t) }