thephpleague / glide

Wonderfully easy on-demand image manipulation library with an HTTP based API.
http://glide.thephpleague.com
MIT License
2.54k stars 198 forks source link

Feature request for base_url option to be regular expression #372

Open camohub opened 1 year ago

camohub commented 1 year ago

This not a bug but feature request for base_url option to be regular expression. I have some dynamic element in image url and I would like to set up base_url option as regular expression. The real use case look like this, but of course it does not work with regexp.:

        $server = ServerFactory::create([
            'response' => new LaravelResponseFactory(app('request')),
            'source' => Storage::disk('do-files')->getDriver(),
            'cache' => Storage::disk('local')->getDriver(),
            'cache_path_prefix' => '/images/cache',
            'base_url' => '#^https://simplaq-portal-files-test-only.[^.]+.digitaloceanspaces.com/#',
        ]);

Is it possible to do it? Thanks for response.