diff options
author | Joas Schilling <coding@schilljs.com> | 2024-01-15 15:39:45 +0100 |
---|---|---|
committer | Joas Schilling <coding@schilljs.com> | 2024-01-15 15:39:45 +0100 |
commit | 57a30e9bbe688bdc4436ba71a5c934d9ef124e35 (patch) | |
tree | c3e70ab534685b1c73b100121be8f89e7e60d7a5 /lib/private/App | |
parent | 32bf74af160482f3f182ce5641f55c80d81c8f19 (diff) | |
download | nextcloud-server-57a30e9bbe688bdc4436ba71a5c934d9ef124e35.tar.gz nextcloud-server-57a30e9bbe688bdc4436ba71a5c934d9ef124e35.zip |
fix(appstore): Only send subscription keys to valid appstores
Signed-off-by: Joas Schilling <coding@schilljs.com>
Diffstat (limited to 'lib/private/App')
-rw-r--r-- | lib/private/App/AppStore/Fetcher/Fetcher.php | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/lib/private/App/AppStore/Fetcher/Fetcher.php b/lib/private/App/AppStore/Fetcher/Fetcher.php index 3e76ab2d5da..a693804f50f 100644 --- a/lib/private/App/AppStore/Fetcher/Fetcher.php +++ b/lib/private/App/AppStore/Fetcher/Fetcher.php @@ -109,10 +109,13 @@ abstract class Fetcher { ]; } - // If we have a valid subscription key, send it to the appstore - $subscriptionKey = $this->config->getAppValue('support', 'subscription_key'); - if ($this->registry->delegateHasValidSubscription() && $subscriptionKey) { - $options['headers']['X-NC-Subscription-Key'] = $subscriptionKey; + if ($this->config->getSystemValueString('appstoreurl', 'https://apps.nextcloud.com/api/v1') === 'https://apps.nextcloud.com/api/v1') { + // If we have a valid subscription key, send it to the appstore + $subscriptionKey = $this->config->getAppValue('support', 'subscription_key'); + if ($this->registry->delegateHasValidSubscription() && $subscriptionKey) { + $options['headers'] ??= []; + $options['headers']['X-NC-Subscription-Key'] = $subscriptionKey; + } } $client = $this->clientService->newClient(); |