1
0
mirror of https://github.com/BookStackApp/BookStack.git synced 2025-07-28 17:02:04 +03:00

Set export service to set correct svg image mimetype

For #1538
This commit is contained in:
Dan Brown
2019-07-17 22:36:49 +01:00
parent 629b7a674e
commit 1e7df28238
3 changed files with 35 additions and 1 deletions

View File

@ -3,6 +3,7 @@
use BookStack\Entities\Chapter;
use BookStack\Entities\Page;
use BookStack\Uploads\HttpFetcher;
class ExportTest extends TestCase
{
@ -148,4 +149,17 @@ class ExportTest extends TestCase
$resp->assertDontSee($page->updated_at->diffForHumans());
}
public function test_page_export_sets_right_data_type_for_svg_embeds()
{
$page = Page::first();
$page->html = '<img src="http://example.com/image.svg">';
$page->save();
$this->asEditor();
$this->mockHttpFetch('<svg></svg>');
$resp = $this->get($page->getUrl('/export/html'));
$resp->assertStatus(200);
$resp->assertSee('<img src="data:image/svg+xml;base64');
}
}