diff --git a/config/dompdf.php b/config/dompdf.php index c37e402..35eef8f 100644 --- a/config/dompdf.php +++ b/config/dompdf.php @@ -91,6 +91,7 @@ * @var array */ 'allowed_protocols' => [ + 'data://' => ['rules' => []], 'file://' => ['rules' => []], 'http://' => ['rules' => []], 'https://' => ['rules' => []], diff --git a/tests/PdfTest.php b/tests/PdfTest.php index 5f87da3..93b90d1 100644 --- a/tests/PdfTest.php +++ b/tests/PdfTest.php @@ -163,4 +163,14 @@ public function testMultipleInstances(): void $this->assertEquals('host1', $pdf1->getDomPDF()->getBaseHost()); $this->assertEquals('host2', $pdf2->getDomPDF()->getBaseHost()); } + + public function testDataImage(): void + { + $pdf = Facade\Pdf::loadHTML(''); + $response = $pdf->download('test.pdf'); + + $this->assertInstanceOf(Response::class, $response); + $this->assertNotEmpty($response->getContent()); + $this->assertEquals(1424, strlen($response->getContent())); + } }