Skip to content

Commit d879022

Browse files
committed
Set to a trailing slash if the path is empty
1 parent 79bd7c2 commit d879022

File tree

3 files changed

+12
-1
lines changed

3 files changed

+12
-1
lines changed

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
# Release Notes for Blitz CloudFront Purger
22

3+
## 5.1.4 - 2025-03-19
4+
5+
### Fixed
6+
7+
- Fixed a bug in which the base site URL was not being purged ([#15](https://github.com/putyourlightson/craft-blitz-cloudfront/issues/15)).
8+
39
## 5.1.3 - 2025-03-12
410

511
### Fixed

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "putyourlightson/craft-blitz-cloudfront",
33
"description": "CloudFront cache purger for the Blitz plugin.",
4-
"version": "5.1.3",
4+
"version": "5.1.4",
55
"type": "craft-plugin",
66
"homepage": "https://putyourlightson.com/plugins/blitz",
77
"license": "proprietary",

src/CloudFrontPurger.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -264,6 +264,11 @@ private function getPathFromUrl(string $url): string
264264
$path = $path . '/';
265265
}
266266

267+
// Set to a trailing slash if the path is empty.
268+
if ($path === '') {
269+
$path = '/';
270+
}
271+
267272
return $path;
268273
}
269274

0 commit comments

Comments
 (0)