Query escape search query

This commit is contained in:
video-prize-ranch 2023-08-10 02:50:41 +00:00 committed by video-prize-ranch
parent 52ae1fc9d5
commit 5dc95f4470

View File

@ -3,6 +3,7 @@ package api
import (
"fmt"
"net/http"
"net/url"
"strings"
"codeberg.org/rimgo/rimgo/utils"
@ -19,6 +20,7 @@ type SearchResult struct {
}
func (client *Client) Search(query string) ([]SearchResult, error) {
query = url.QueryEscape(query)
req, err := http.NewRequest("GET", "https://imgur.com/search?q=" + query, nil)
if err != nil {
return []SearchResult{}, err