From: Roeland Jago Douma Date: Thu, 20 Aug 2020 07:00:03 +0000 (+0200) Subject: Allow using geolocation in the dashboard X-Git-Tag: v20.0.0beta1~30^2 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=f6578b74f43f5ef860c1850bc6c4c176d80135f5;p=nextcloud-server.git Allow using geolocation in the dashboard Else the weather geolocation is kind of useless. Signed-off-by: Roeland Jago Douma --- diff --git a/apps/dashboard/lib/Controller/DashboardController.php b/apps/dashboard/lib/Controller/DashboardController.php index 40ed026b82b..8f845ca9b6a 100644 --- a/apps/dashboard/lib/Controller/DashboardController.php +++ b/apps/dashboard/lib/Controller/DashboardController.php @@ -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; } /**