mirror of
https://github.com/MetaCubeX/mihomo.git
synced 2025-01-07 09:53:58 +08:00
fix: rule provider http api crash
This commit is contained in:
parent
c161d5e6be
commit
22c1e05e1c
@ -94,8 +94,8 @@ func getRuleProviders(w http.ResponseWriter, r *http.Request) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func updateRuleProvider(w http.ResponseWriter, r *http.Request) {
|
func updateRuleProvider(w http.ResponseWriter, r *http.Request) {
|
||||||
provider := r.Context().Value(CtxKeyProvider).(*provider.RuleProvider)
|
provider := r.Context().Value(CtxKeyProvider).(provider.RuleProvider)
|
||||||
if err := (*provider).Update(); err != nil {
|
if err := provider.Update(); err != nil {
|
||||||
render.Status(r, http.StatusServiceUnavailable)
|
render.Status(r, http.StatusServiceUnavailable)
|
||||||
render.JSON(w, r, newError(err.Error()))
|
render.JSON(w, r, newError(err.Error()))
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user