send `Accept: text/html` header

closes #106
parent 9534363d
......@@ -69,6 +69,9 @@ function fetch($url, $convertClassic = true, &$curlInfo=null) {
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt($ch, CURLOPT_MAXREDIRS, 5);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
'Accept: text/html'
));
$html = curl_exec($ch);
$info = $curlInfo = curl_getinfo($ch);
curl_close($ch);
......
......@@ -31,9 +31,7 @@ if (!file_exists($url)) {
}
}
$html = file_get_contents($url);
$result = Mf2\parse($html, $url);
$result = Mf2\fetch($url);
if (defined('JSON_PRETTY_PRINT')) {
echo json_encode($result, JSON_PRETTY_PRINT);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment