link-preview icon indicating copy to clipboard operation
link-preview copied to clipboard

Unexpected cover and images value in response

Open hasnat-we opened this issue 1 year ago • 0 comments

Thanks in advance for this nice plugin.

$url = 'https://http.cat/404.jpg';
$linkPreview   = new Client($url);
$parsedGeneral = $linkPreview->getPreview('general')->toArray();

Following is the response I get:

array:7 [▼
  "cover" => GuzzleHttp\Psr7\Uri {#2588 ▼
    -scheme: "https"
    -userInfo: ""
    -host: "http.cat"
    -port: null
    -path: "/404.jpg"
    -query: ""
    -fragment: ""
  }
  "images" => array:1 [▼
    0 => GuzzleHttp\Psr7\Uri {#2588 ▶}
  ]
  "title" => null
  "description" => null
  "video" => null
  "videoType" => null
  "url" => "https://http.cat/404.jpg"
]

Expected response: cover: expected null or string, but GuzzleHttp\Psr7\Uri returned images: expected [] empty array, but array of GuzzleHttp\Psr7\Uri returned

Can we expect expected data type? Thanks

hasnat-we avatar Mar 13 '23 20:03 hasnat-we