diff --git a/search.go b/search.go index 5cf27699..9876c2b2 100644 --- a/search.go +++ b/search.go @@ -43,7 +43,7 @@ func parseSearch(value string) *searchOptions { } // search searches for a file or directory. -func search(w http.ResponseWriter, r *http.Request, c *FileManager, u *User) (int, error) { +func search(w http.ResponseWriter, r *http.Request, m *FileManager, u *User) (int, error) { // Upgrades the connection to a websocket and checks for errors. conn, err := upgrader.Upgrade(w, r, nil) if err != nil { @@ -71,7 +71,7 @@ func search(w http.ResponseWriter, r *http.Request, c *FileManager, u *User) (in } search = parseSearch(value) - scope := strings.Replace(r.URL.Path, c.BaseURL, "", 1) + scope := strings.Replace(r.URL.Path, m.BaseURL, "", 1) scope = strings.TrimPrefix(scope, "/") scope = "/" + scope scope = u.scope + scope