Skip to content

Commit

Permalink
Pdfexport: Add variable type hint
Browse files Browse the repository at this point in the history
  • Loading branch information
sukhwinder33445 committed Aug 23, 2023
1 parent 2d2d51e commit c9e5876
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion library/Pdfexport/ProvidedHook/Pdfexport.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
use Icinga\Application\Hook;
use Icinga\Application\Hook\PdfexportHook;
use Icinga\Application\Icinga;
use Icinga\Application\Web;
use Icinga\Module\Pdfexport\HeadlessChrome;
use Icinga\Module\Pdfexport\PrintableHtmlDocument;
use iio\libmergepdf\Driver\TcpdiDriver;
Expand Down Expand Up @@ -123,7 +124,9 @@ public function streamPdfFromHtml($html, $filename)
$pdf = $merger->merge();
}

Icinga::app()->getResponse()
/** @var Web $app */
$app = Icinga::app();
$app->getResponse()
->setHeader('Content-Type', 'application/pdf', true)
->setHeader('Content-Disposition', "inline; filename=\"$filename\"", true)
->setBody($pdf)
Expand Down

0 comments on commit c9e5876

Please sign in to comment.