Use CurlResult->getHeaderArray instead of custom conversion

This commit is contained in:
Hypolite Petovan 2020-10-23 02:03:28 -04:00
parent 54600b5f2b
commit 9e143287d6

View file

@ -88,16 +88,8 @@ function parse_url_content(App $a)
$curlResponse = DI::httpRequest()->head($url);
if ($curlResponse->isSuccess()) {
// Convert the header fields into an array
$hdrs = [];
$h = explode("\n", $curlResponse->getHeader());
foreach ($h as $l) {
$header = array_map('trim', explode(':', trim($l), 2));
if (count($header) == 2) {
list($k, $v) = $header;
$hdrs[$k] = $v;
}
}
$hdrs = $curlResponse->getHeaderArray();
$type = null;
$content_type = '';
$bbcode = '';