Move to go-modrinth lib (v2 API) and always supply UA in HTTP requests

This commit is contained in:
comp500
2022-08-02 02:53:31 +01:00
parent 5c02b31e20
commit 044c34e07c
10 changed files with 97 additions and 315 deletions

View File

@@ -5,7 +5,6 @@ import (
"encoding/json"
"fmt"
"io/ioutil"
"net/http"
"os"
"path/filepath"
"sort"
@@ -267,7 +266,7 @@ func (m mcVersionManifest) checkValid(version string) {
}
func getValidMCVersions() (mcVersionManifest, error) {
res, err := http.Get("https://launchermeta.mojang.com/mc/game/version_manifest.json")
res, err := core.GetWithUA("https://launchermeta.mojang.com/mc/game/version_manifest.json", "application/json")
if err != nil {
return mcVersionManifest{}, err
}