Skip to content

Commit

Permalink
fix redirect to Djatoka viewer with http
Browse files Browse the repository at this point in the history
  • Loading branch information
krkabol committed Mar 4, 2025
1 parent 5374887 commit add13d8
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 3 additions & 2 deletions htdocs/src/Controller/Front/SearchFormController.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
use PhpOffice\PhpSpreadsheet\Writer\Xlsx;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\HttpFoundation\JsonResponse;
use Symfony\Component\HttpFoundation\RedirectResponse;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\HttpFoundation\StreamedResponse;
Expand Down Expand Up @@ -150,8 +151,8 @@ public function showImage(#[MapQueryParameter] string $filename, #[MapQueryParam
case 'thumbs': // unused
return $this->json($this->imageService->getPicInfo($picDetails));
case 'show': // detail, ajax/results.php
$url = $this->imageService->doRedirectShowPic($picDetails);
break;
$url = $this->imageService->getExternalImageViewerUrl($picDetails);
return new RedirectResponse($url, 303, ['X-Content-Type-Options' => 'nosniff']);
}

$streamContext = stream_context_create([
Expand Down
2 changes: 1 addition & 1 deletion htdocs/src/Service/ImageService.php
Original file line number Diff line number Diff line change
Expand Up @@ -346,7 +346,7 @@ protected function parser ($text)
return $result;
}

function doRedirectShowPic($picdetails): string
function getExternalImageViewerUrl($picdetails): string
{
if ($picdetails['imgserver_type'] == 'iiif') {
$url = "https://services.jacq.org/jacq-services/rest/images/show/{$picdetails['specimenID']}?withredirect=1";
Expand Down

0 comments on commit add13d8

Please sign in to comment.