search a go
This commit is contained in:
@@ -325,7 +325,6 @@ func (server *Server) apiV0FilesIDPutHandler(w http.ResponseWriter, r *http.Requ
|
||||
}
|
||||
|
||||
func (server *Server) apiV0SearchHandler(w http.ResponseWriter, r *http.Request) error {
|
||||
// TODO case insensitive
|
||||
query := r.URL.Query().Get("q")
|
||||
queries := strings.Split(query, " ")
|
||||
if len(queries) == 0 {
|
||||
@@ -337,7 +336,7 @@ func (server *Server) apiV0SearchHandler(w http.ResponseWriter, r *http.Request)
|
||||
for _, query := range queries {
|
||||
if len(query) > 0 {
|
||||
query = unsafepattern.ReplaceAllString(query, ".")
|
||||
patterns = append(patterns, regexp.MustCompile(query))
|
||||
patterns = append(patterns, regexp.MustCompile("(?i)"+query))
|
||||
}
|
||||
}
|
||||
if len(patterns) == 0 {
|
||||
|
||||
Reference in New Issue
Block a user