Skip to content

Commit

Permalink
Only proxy images through cover proxy.
Browse files Browse the repository at this point in the history
  • Loading branch information
demiankatz committed Feb 5, 2024
1 parent 40ae884 commit 8e33ade
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
11 changes: 7 additions & 4 deletions module/VuFind/src/VuFind/Controller/CoverController.php
Original file line number Diff line number Diff line change
Expand Up @@ -129,10 +129,13 @@ public function showAction()
if (!empty($url)) {
try {
$image = $this->proxy->fetch($url);
return $this->displayImage(
$image->getHeaders()->get('content-type')->getFieldValue(),
$image->getContent()
);
$contentType = $image->getHeaders()->get('content-type')->getFieldValue();
if (str_starts_with($contentType, 'image/')) {
return $this->displayImage(
$contentType,
$image->getContent()
);
}
} catch (\Exception $e) {
// If an exception occurs, drop through to the standard case
// to display an image unavailable graphic.
Expand Down
1 change: 1 addition & 0 deletions module/VuFind/tests/.phpunit.cache/test-results

Large diffs are not rendered by default.

0 comments on commit 8e33ade

Please sign in to comment.