Fixed api calls not following PROXY guidelines: https://github.com/Shuffle/Shuffle/issues/1318

This commit is contained in:
Frikky
2024-02-01 14:32:31 +01:00
parent 625561f763
commit 3628812ff6
3 changed files with 11 additions and 48 deletions
+2 -2
View File
@@ -798,7 +798,7 @@ func getDockerImage(resp http.ResponseWriter, request *http.Request) {
// Downloads and activates an app from shuffler.io if possible
func handleRemoteDownloadApp(resp http.ResponseWriter, ctx context.Context, user shuffle.User, appId string) {
url := fmt.Sprintf("https://shuffler.io/api/v1/apps/%s/config", appId)
log.Printf("Downloading API from %s", url)
log.Printf("[DEBUG] Downloading API from URL %s", url)
req, err := http.NewRequest(
"GET",
url,
@@ -812,7 +812,7 @@ func handleRemoteDownloadApp(resp http.ResponseWriter, ctx context.Context, user
return
}
httpClient := &http.Client{}
httpClient := shuffle.GetExternalClient(url)
newresp, err := httpClient.Do(req)
if err != nil {
log.Printf("[ERROR] Failed running auto-download request for %s: %s", appId, err)