mirror of
https://github.com/usetrmnl/byos_laravel.git
synced 2026-01-13 23:18:10 +00:00
fix: sleep.png misinterpreted as bmp, when using proxy.
This commit is contained in:
parent
23077ea445
commit
ae66d15051
1 changed files with 6 additions and 1 deletions
|
|
@ -11,6 +11,7 @@ use Illuminate\Queue\SerializesModels;
|
|||
use Illuminate\Support\Facades\Http;
|
||||
use Illuminate\Support\Facades\Log;
|
||||
use Illuminate\Support\Facades\Storage;
|
||||
use Illuminate\Support\Str;
|
||||
|
||||
class FetchProxyCloudResponses implements ShouldQueue
|
||||
{
|
||||
|
|
@ -48,7 +49,11 @@ class FetchProxyCloudResponses implements ShouldQueue
|
|||
$imageType = urldecode($queryParams['response-content-type'] ?? 'image/bmp');
|
||||
$imageExtension = $imageType === 'image/png' ? 'png' : 'bmp';
|
||||
|
||||
\Log::info('Response data: '.$imageUrl);
|
||||
if (Str::contains($imageUrl, '.png')) {
|
||||
$imageExtension = 'png';
|
||||
}
|
||||
|
||||
\Log::info("Response data: $imageUrl. Image Extension: $imageExtension");
|
||||
if (isset($imageUrl)) {
|
||||
try {
|
||||
$imageContents = Http::get($imageUrl)->body();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue