mirror of
https://github.com/packwiz/packwiz.git
synced 2025-04-20 13:36:29 +02:00
Fix query encoding in CurseForge search (fixes #44)
This commit is contained in:
parent
690d4e1a54
commit
7ac193eb87
@ -287,14 +287,16 @@ func getSearch(searchText string, gameVersion string, modloaderType int) ([]modI
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return []modInfo{}, err
|
return []modInfo{}, err
|
||||||
}
|
}
|
||||||
reqURL.Query().Set("searchFilter", searchText)
|
q := reqURL.Query()
|
||||||
|
q.Set("searchFilter", searchText)
|
||||||
|
|
||||||
if len(gameVersion) > 0 {
|
if len(gameVersion) > 0 {
|
||||||
reqURL.Query().Set("gameVersion", gameVersion)
|
q.Set("gameVersion", gameVersion)
|
||||||
}
|
}
|
||||||
if modloaderType != modloaderTypeAny {
|
if modloaderType != modloaderTypeAny {
|
||||||
reqURL.Query().Set("modLoaderType", strconv.Itoa(modloaderType))
|
q.Set("modLoaderType", strconv.Itoa(modloaderType))
|
||||||
}
|
}
|
||||||
|
reqURL.RawQuery = q.Encode()
|
||||||
|
|
||||||
req, err := http.NewRequest("GET", reqURL.String(), nil)
|
req, err := http.NewRequest("GET", reqURL.String(), nil)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user