Skip to content

Commit

Permalink
Fixed #16793
Browse files Browse the repository at this point in the history
  • Loading branch information
brandonkelly committed Feb 27, 2025
1 parent 67ba094 commit 46e4ada
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Release Notes for Craft CMS 4

## Unreleased

- Fixed an error that could occur when generating an image transform URL via a console request. ([#16793](https://github.com/craftcms/cms/issues/16793))

## 4.14.9 - 2025-02-25

- Added `craft\base\ElementTrait::$isNewSite`.
Expand Down
4 changes: 3 additions & 1 deletion src/imagetransforms/ImageTransformer.php
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,9 @@ public function getTransformUrl(Asset $asset, ImageTransform $imageTransform, bo
]), 2048);

// Prevent the page from being cached
Craft::$app->getResponse()->setNoCacheHeaders();
if (!Craft::$app->getRequest()->getIsConsoleRequest()) {
Craft::$app->getResponse()->setNoCacheHeaders();
}

// Return the temporary transform URL
return UrlHelper::actionUrl('assets/generate-transform', [
Expand Down

0 comments on commit 46e4ada

Please # to comment.