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