Commit 8d698b4 1 parent d2b3a15 commit 8d698b4 Copy full SHA for 8d698b4
File tree 2 files changed +11
-0
lines changed
2 files changed +11
-0
lines changed Original file line number Diff line number Diff line change 91
91
* @var array
92
92
*/
93
93
'allowed_protocols ' => [
94
+ 'data:// ' => ['rules ' => []],
94
95
'file:// ' => ['rules ' => []],
95
96
'http:// ' => ['rules ' => []],
96
97
'https:// ' => ['rules ' => []],
Original file line number Diff line number Diff line change @@ -163,4 +163,14 @@ public function testMultipleInstances(): void
163
163
$ this ->assertEquals ('host1 ' , $ pdf1 ->getDomPDF ()->getBaseHost ());
164
164
$ this ->assertEquals ('host2 ' , $ pdf2 ->getDomPDF ()->getBaseHost ());
165
165
}
166
+
167
+ public function testDataImage (): void
168
+ {
169
+ $ pdf = Facade \Pdf::loadHTML ('<img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAoAAAAKCAIAAAACUFjqAAAAEklEQVR4nGP8z4APMOGVHbHSAEEsAROxCnMTAAAAAElFTkSuQmCC" /> ' );
170
+ $ response = $ pdf ->download ('test.pdf ' );
171
+
172
+ $ this ->assertInstanceOf (Response::class, $ response );
173
+ $ this ->assertNotEmpty ($ response ->getContent ());
174
+ $ this ->assertEquals (1424 , strlen ($ response ->getContent ()));
175
+ }
166
176
}
You can’t perform that action at this time.
0 commit comments