Skip to content

Commit a34b42e

Browse files
committed
feat(whitelisting): Explicitly tell which app is blocked to user
Signed-off-by: Louis Chmn <louis@chmn.me>
1 parent 3d8c274 commit a34b42e

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

lib/AppWhitelist.php

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,10 +77,13 @@ public function isUrlAllowed(IUser $user, string|false $url): bool {
7777
}
7878

7979
public function verifyAccess(IUser $user, IRequest $request): void {
80-
if (!$this->isUrlAllowed($user, $request->getPathInfo())) {
80+
$url = $request->getPathInfo();
81+
$app = $this->getRequestedApp($url);
82+
83+
if (!$this->isUrlAllowed($user, $url)) {
8184
header('HTTP/1.0 403 Forbidden');
8285
Template::printErrorPage($this->l10n->t(
83-
'Access to this resource is forbidden for guests.'
86+
"Access to this resource ($app) is forbidden for guests."
8487
));
8588
exit;
8689
}

0 commit comments

Comments
 (0)