Send correct mimetype for ComputedRawPage in live mode
This commit is contained in:
parent
a825b1a28b
commit
4c9cbed9da
@ -11,6 +11,11 @@ abstract class ComputedRawPage implements Page
|
||||
$this->raw = $content;
|
||||
}
|
||||
|
||||
public function getFilename()
|
||||
{
|
||||
return $this->raw->getUri();
|
||||
}
|
||||
|
||||
public function getContent()
|
||||
{
|
||||
return $this->raw->getContent();
|
||||
|
@ -4,6 +4,7 @@ use Symfony\Component\Console\Output\NullOutput;
|
||||
use Todaymade\Daux\Daux;
|
||||
use Todaymade\Daux\DauxHelper;
|
||||
use Todaymade\Daux\Exception;
|
||||
use Todaymade\Daux\Format\Base\ComputedRawPage;
|
||||
use Todaymade\Daux\Format\Base\LiveGenerator;
|
||||
use Todaymade\Daux\Format\HTML\RawPage;
|
||||
|
||||
@ -59,7 +60,12 @@ class Server
|
||||
return;
|
||||
}
|
||||
|
||||
header('Content-type: text/html; charset=utf-8');
|
||||
if ($page instanceof ComputedRawPage) {
|
||||
header('Content-type: ' . MimeType::get($page->getFilename()));
|
||||
} else {
|
||||
header('Content-type: text/html; charset=utf-8');
|
||||
}
|
||||
|
||||
echo $page->getContent();
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user