mirror of
				https://github.com/packwiz/packwiz.git
				synced 2025-10-31 10:34:32 +01:00 
			
		
		
		
	Fix query encoding in CurseForge search (fixes #44)
This commit is contained in:
		| @@ -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 { | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user