From 8023e29519683885199a1c2e5b21725d4509895c Mon Sep 17 00:00:00 2001 From: Nikias Bassen Date: Thu, 28 Nov 2024 23:13:18 +0100 Subject: [PATCH] Fix authentication and download --- pkg/appstore/appstore_download.go | 4 +--- pkg/appstore/appstore_login.go | 7 +------ 2 files changed, 2 insertions(+), 9 deletions(-) diff --git a/pkg/appstore/appstore_download.go b/pkg/appstore/appstore_download.go index 9a3d307e..e9bb5dff 100644 --- a/pkg/appstore/appstore_download.go +++ b/pkg/appstore/appstore_download.go @@ -140,10 +140,8 @@ func (t *appstore) downloadFile(src, dst string, progress *progressbar.ProgressB } func (*appstore) downloadRequest(acc Account, app App, guid string) http.Request { - host := fmt.Sprintf("%s-%s", PrivateAppStoreAPIDomainPrefixWithoutAuthCode, PrivateAppStoreAPIDomain) - return http.Request{ - URL: fmt.Sprintf("https://%s%s?guid=%s", host, PrivateAppStoreAPIPathDownload, guid), + URL: fmt.Sprintf("https://%s%s?guid=%s", PrivateAppStoreAPIDomain, PrivateAppStoreAPIPathDownload, guid), Method: http.MethodPOST, ResponseFormat: http.ResponseFormatXML, Headers: map[string]string{ diff --git a/pkg/appstore/appstore_login.go b/pkg/appstore/appstore_login.go index ca5c59d9..37d919ee 100644 --- a/pkg/appstore/appstore_login.go +++ b/pkg/appstore/appstore_login.go @@ -134,11 +134,6 @@ func (t *appstore) loginRequest(email, password, authCode, guid string) http.Req } func (*appstore) authDomain(authCode, guid string) string { - prefix := PrivateAppStoreAPIDomainPrefixWithoutAuthCode - if authCode != "" { - prefix = PrivateAppStoreAPIDomainPrefixWithAuthCode - } - return fmt.Sprintf( - "https://%s-%s%s?guid=%s", prefix, PrivateAppStoreAPIDomain, PrivateAppStoreAPIPathAuthenticate, guid) + "https://%s%s?guid=%s", PrivateAppStoreAPIDomain, PrivateAppStoreAPIPathAuthenticate, guid) }