Skip to content

Commit

Permalink
Merge pull request #1727 from rmikalkenas/public-temporary-url-normal…
Browse files Browse the repository at this point in the history
…izer

Normalize path when generating public or temporary url
  • Loading branch information
frankdejonge authored Nov 14, 2023
2 parents 1b2aa10 + 39069d5 commit 9362286
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/Filesystem.php
Original file line number Diff line number Diff line change
Expand Up @@ -187,15 +187,19 @@ public function publicUrl(string $path, array $config = []): string
?? throw UnableToGeneratePublicUrl::noGeneratorConfigured($path);
$config = $this->config->extend($config);

return $this->publicUrlGenerator->publicUrl($path, $config);
return $this->publicUrlGenerator->publicUrl($this->pathNormalizer->normalizePath($path), $config);
}

public function temporaryUrl(string $path, DateTimeInterface $expiresAt, array $config = []): string
{
$generator = $this->temporaryUrlGenerator ?? $this->adapter;

if ($generator instanceof TemporaryUrlGenerator) {
return $generator->temporaryUrl($path, $expiresAt, $this->config->extend($config));
return $generator->temporaryUrl(
$this->pathNormalizer->normalizePath($path),
$expiresAt,
$this->config->extend($config)
);
}

throw UnableToGenerateTemporaryUrl::noGeneratorConfigured($path);
Expand Down

0 comments on commit 9362286

Please sign in to comment.