Skip to content

Commit 5415109

Browse files
committed
fix merge of trusted apps
1 parent be30983 commit 5415109

2 files changed

Lines changed: 10 additions & 2 deletions

File tree

lib/Routes/SolidStorage.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,11 @@ public static function respondToStorage() {
4343
$owner = StorageServer::getOwner();
4444

4545
$allowedClients = $owner['allowedClients'] ?? [];
46-
$allowedOrigins = ($owner['allowedOrigins'] ?? []) + (TRUSTED_APPS ?? []);
46+
$allowedOrigins = array_merge(
47+
($owner['allowedOrigins'] ?? []),
48+
(TRUSTED_APPS ?? [])
49+
);
50+
$allowedOrigins = array_unique($allowedOrigins);
4751

4852
if (!isset($origin) || ($origin === "")) {
4953
$allowedOrigins[] = "app://unset"; // FIXME: this should not be here.

lib/Routes/SolidUserProfile.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,11 @@ public static function respondToProfile() {
4646
$owner = ProfileServer::getOwner();
4747

4848
$allowedClients = $owner['allowedClients'] ?? [];
49-
$allowedOrigins = ($owner['allowedOrigins'] ?? []) + (TRUSTED_APPS ?? []);
49+
$allowedOrigins = array_merge(
50+
($owner['allowedOrigins'] ?? []),
51+
(TRUSTED_APPS ?? [])
52+
);
53+
$allowedOrigins = array_unique($allowedOrigins);
5054
if (!isset($origin) || ($origin === "")) {
5155
$allowedOrigins[] = "app://unset"; // FIXME: this should not be here.
5256
$origin = "app://unset";

0 commit comments

Comments
 (0)