]> source.dussan.org Git - nextcloud-server.git/commitdiff
Allow using geolocation in the dashboard 22313/head
authorRoeland Jago Douma <roeland@famdouma.nl>
Thu, 20 Aug 2020 07:00:03 +0000 (09:00 +0200)
committerRoeland Jago Douma <roeland@famdouma.nl>
Thu, 20 Aug 2020 07:00:03 +0000 (09:00 +0200)
Else the weather geolocation is kind of useless.

Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
apps/dashboard/lib/Controller/DashboardController.php

index 40ed026b82b6efe3d88703d0b0cba99d92defa6a..8f845ca9b6aad4d2e28eac2ef4c6cb31876d2bb4 100644 (file)
@@ -111,7 +111,14 @@ class DashboardController extends Controller {
                $this->inititalStateService->provideInitialState('dashboard', 'version', $this->config->getUserValue($this->userId, 'dashboard', 'backgroundVersion', 0));
                $this->config->setUserValue($this->userId, 'dashboard', 'firstRun', '0');
 
-               return new TemplateResponse('dashboard', 'index');
+               $response = new TemplateResponse('dashboard', 'index');
+
+               // For the weather widget we should allow the geolocation
+               $featurePolicy = new Http\FeaturePolicy();
+               $featurePolicy->addAllowedGeoLocationDomain('\'self\'');
+               $response->setFeaturePolicy($featurePolicy);
+
+               return $response;
        }
 
        /**