1
0
mirror of https://github.com/RSS-Bridge/rss-bridge.git synced 2025-08-06 16:46:30 +02:00

Formats: Remove display & related method (#2776)

Format should not be responsible for sending HTTP response.
This commit is contained in:
Jan Tojnar
2022-06-07 18:05:33 +02:00
committed by GitHub
parent e85932b1a5
commit fb501652d5
13 changed files with 11 additions and 178 deletions

View File

@@ -244,8 +244,14 @@ class DisplayAction extends ActionAbstract {
$format = $formatFac->create($format);
$format->setItems($items);
$format->setExtraInfos($infos);
$format->setLastModified($cache->getTime());
$format->display();
$lastModified = $cache->getTime();
$format->setLastModified($lastModified);
if ($lastModified) {
header('Last-Modified: ' . gmdate('D, d M Y H:i:s ', $lastModified) . 'GMT');
}
header('Content-Type: ' . $format->getMimeType() . '; charset=' . $format->getCharset());
echo $format->stringify();
} catch(Error $e) {
error_log($e);
header('Content-Type: text/html', true, $e->getCode());