Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions Classes/Eid/PageViewProxy.php
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,16 @@ protected function handleHead(ServerRequestInterface $request): ResponseInterfac
$queryParams = $request->getQueryParams();

$url = (string) ($queryParams['url'] ?? '');
if (!Helper::isValidHttpUrl($url)) {
return new JsonResponse(['message' => 'Did not receive a valid URL.'], 400);
}

// get and verify the uHash
$uHash = (string) ($queryParams['uHash'] ?? '');
if (!hash_equals(GeneralUtility::hmac($url, 'PageViewProxy'), $uHash)) {
return new JsonResponse(['message' => 'No valid uHash passed!'], 401);
}

$headers = [
'User-Agent' => $this->extConf['userAgent'] ?? 'Kitodo.Presentation'
];
Expand Down
2 changes: 1 addition & 1 deletion ext_emconf.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
$EM_CONF[$_EXTKEY] = [
'title' => 'Kitodo.Presentation',
'description' => 'Base plugins, modules, services and API of the Digital Library Framework. It is part of the community-based Kitodo Digitization Suite.',
'version' => '5.0.10',
'version' => '5.0.11',
'category' => 'misc',
'constraints' => [
'depends' => [
Expand Down
Loading