Skip to content

Commit

Permalink
Support glide urls with URL params
Browse files Browse the repository at this point in the history
  • Loading branch information
ryanmitchell committed Oct 23, 2024
1 parent cce7045 commit ad5fa11
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/Imaging/GlideManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,7 @@ private function getCachePathCallable()
$hashCallable = $this->getHashCallable();

return function ($path, $params) use ($hashCallable) {
$path = Str::before($path, '?');
$sourcePath = $this->getSourcePath($path);

if ($this->sourcePathPrefix) {
Expand Down
3 changes: 2 additions & 1 deletion src/Imaging/ImageGenerator.php
Original file line number Diff line number Diff line change
Expand Up @@ -118,13 +118,14 @@ private function doGenerateByUrl($url, array $params)
$this->skip_validation = true;
$this->setParams($params);

$qs = Str::after($url, '?');
$parsed = $this->parseUrl($url);

$this->server->setSource($this->guzzleSourceFilesystem($parsed['base']));
$this->server->setSourcePathPrefix('/');
$this->server->setCachePathPrefix('http');

return $this->generate($parsed['path']);
return $this->generate($parsed['path'].($qs ? '?'.$qs : ''));
}

/**
Expand Down

0 comments on commit ad5fa11

Please sign in to comment.