Skip to content

Commit c716ed5

Browse files
committed
remove var dumps, replace @alice with ~alice
1 parent 4d97c3d commit c716ed5

2 files changed

Lines changed: 4 additions & 10 deletions

File tree

solid/lib/Controller/GetStorageUrlTrait.php

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -65,15 +65,9 @@ public function validateUrl(RequestInterface $request): bool {
6565
$pathUsers = array_filter($pathParts, static function ($value) {
6666
return str_starts_with($value, '~');
6767
});
68-
var_dump($host);
69-
var_dump($path);
70-
var_dump($pathParts);
71-
var_dump($pathUsers);
7268
if (count($pathUsers) === 1) {
7369
$pathUser = reset($pathUsers);
7470
$subDomainUser = explode('.', $host)[0];
75-
var_dump($pathUser);
76-
var_dump($subDomainUser);
7771

7872
$isValid = $pathUser === '~' . $subDomainUser;
7973
}

solid/tests/Unit/Controller/GetStorageUrlTraitTest.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -150,13 +150,13 @@ public function provideRequests()
150150

151151
return [
152152
'invalid: invalid URL' => ['request' => $request->withUri(new Uri('!@#$%^&*()_')), 'expected' => false],
153-
'invalid: no domain user' => ['request' => $request->withUri(new Uri('https://example.com/@alice/profile/card#me')), 'expected' => false],
153+
'invalid: no domain user' => ['request' => $request->withUri(new Uri('https://example.com/~alice/profile/card#me')), 'expected' => false],
154154
'invalid: no path or domain user' => ['request' => $request->withUri(new Uri('https://example.com/')), 'expected' => false],
155155
'invalid: no path user' => ['request' => $request->withUri(new Uri('https://alice.example.com/profile/card#me')), 'expected' => false],
156156
'invalid: no URL' => ['request' => $request, 'expected' => false],
157-
'invalid: path and domain user mismatch' => ['request' => $request->withUri(new Uri('https://bob.example.com/@alice/profile/card#me')), 'expected' => false],
158-
'valid: minimal path and domain user match' => ['request' => $request->withUri(new Uri('https://alice.example.com/apps/@alice')), 'expected' => true],
159-
'valid: path and domain user match' => ['request' => $request->withUri(new Uri('https://alice.example.com/apps/solid/@alice/profile/card#me')), 'expected' => true],
157+
'invalid: path and domain user mismatch' => ['request' => $request->withUri(new Uri('https://bob.example.com/~alice/profile/card#me')), 'expected' => false],
158+
'valid: minimal path and domain user match' => ['request' => $request->withUri(new Uri('https://alice.example.com/apps/~alice')), 'expected' => true],
159+
'valid: path and domain user match' => ['request' => $request->withUri(new Uri('https://alice.example.com/apps/solid/~alice/profile/card#me')), 'expected' => true],
160160
];
161161
}
162162

0 commit comments

Comments
 (0)