mirror of
https://github.com/packwiz/packwiz.git
synced 2025-10-21 00:54:31 +02:00
Re-encode URLs from CF and when exporting to MR for RFC3986 compliance
This commit is contained in:
@@ -135,6 +135,13 @@ var exportCmd = &cobra.Command{
|
||||
serverEnv = envInstalled
|
||||
}
|
||||
|
||||
// Modrinth URLs must be RFC3986
|
||||
u, err := core.ReencodeURL(mod.Download.URL)
|
||||
if err != nil {
|
||||
fmt.Printf("Error re-encoding mod URL: %s\n", err.Error())
|
||||
u = mod.Download.URL
|
||||
}
|
||||
|
||||
manifestFiles[i] = PackFile{
|
||||
Path: path,
|
||||
Hashes: hashes,
|
||||
@@ -142,7 +149,7 @@ var exportCmd = &cobra.Command{
|
||||
Client string `json:"client"`
|
||||
Server string `json:"server"`
|
||||
}{Client: clientEnv, Server: serverEnv},
|
||||
Downloads: []string{mod.Download.URL},
|
||||
Downloads: []string{u},
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user