From 99625da1e44b4e6686f3c4b29526949ef471a100 Mon Sep 17 00:00:00 2001 From: Simon Zolin Date: Mon, 3 Aug 2020 14:09:47 +0300 Subject: [PATCH] - "set_url": couldn't set a new path for filter local file --- home/control_filtering.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/home/control_filtering.go b/home/control_filtering.go index 4c820ec1..e3dd9d46 100644 --- a/home/control_filtering.go +++ b/home/control_filtering.go @@ -17,8 +17,8 @@ import ( "github.com/miekg/dns" ) -// IsValidURL - return TRUE if URL or file path is valid -func IsValidURL(rawurl string) bool { +// isValidURL - return TRUE if URL or file path is valid +func isValidURL(rawurl string) bool { if filepath.IsAbs(rawurl) { // this is a file path return util.FileExists(rawurl) @@ -48,7 +48,7 @@ func (f *Filtering) handleFilteringAddURL(w http.ResponseWriter, r *http.Request return } - if !IsValidURL(fj.URL) { + if !isValidURL(fj.URL) { http.Error(w, "Invalid URL or file path", http.StatusBadRequest) return } @@ -155,7 +155,7 @@ func (f *Filtering) handleFilteringSetURL(w http.ResponseWriter, r *http.Request return } - if !IsValidURL(fj.URL) { + if !isValidURL(fj.Data.URL) { http.Error(w, "invalid URL or file path", http.StatusBadRequest) return }