Skip to content

Commit 5689d7e

Browse files
committed
more adjusts
1 parent 3869440 commit 5689d7e

File tree

2 files changed

+15
-1
lines changed

2 files changed

+15
-1
lines changed

src/Http/CurlDispatcher.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ class CurlDispatcher implements DispatcherInterface
2323
CURLOPT_FOLLOWLOCATION => true,
2424
CURLOPT_USERAGENT => 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.95 Safari/537.36',
2525
CURLOPT_IPRESOLVE => CURL_IPRESOLVE_V4,
26-
CURLOPT_HTTPHEADER => ['Accept: text/html'],
2726
];
2827

2928
/**
@@ -80,6 +79,7 @@ public function dispatch(Url $url)
8079
{
8180
$connection = curl_init((string) $url);
8281
curl_setopt_array($connection, $this->config);
82+
curl_setopt($connection, CURLOPT_HTTPHEADER, ['Accept: text/html']);
8383

8484
$curl = new CurlResult($connection);
8585

src/Providers/OEmbed/Spotify.php

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,22 @@
22

33
namespace Embed\Providers\OEmbed;
44

5+
use Embed\Http\Url;
6+
57
class Spotify extends EndPoint implements EndPointInterface
68
{
79
protected static $pattern = '*.spotify.com/*';
810
protected static $endPoint = 'https://embed.spotify.com/oembed';
11+
12+
/**
13+
* {@inheritdoc}
14+
*/
15+
public function getEndPoint()
16+
{
17+
return Url::create(static::$endPoint)
18+
->withQueryParameters([
19+
'url' => (string) $this->response->getUrl()->withQueryParameters([]),
20+
'format' => 'json'
21+
]);
22+
}
923
}

0 commit comments

Comments
 (0)