summaryrefslogtreecommitdiff
path: root/Libraries/LibCore/MimeData.cpp
diff options
context:
space:
mode:
authorSimon Danner <danner.simon@gmail.com>2020-09-07 19:45:14 +0200
committerAndreas Kling <kling@serenityos.org>2020-09-08 13:57:18 +0200
commit05be6481b74b9a91897ae54e38f7442c2797fd05 (patch)
tree295e3ae6c81a58a3f031517b9bf395a4d18b804f /Libraries/LibCore/MimeData.cpp
parent699e1fdc07e69419f17faa191930b5d604a9640b (diff)
downloadserenity-05be6481b74b9a91897ae54e38f7442c2797fd05.zip
LibWeb: make it possible to directly load .svg files
Make LibWeb load svg files by guessing the svg mime type from the file extension and parsing it with the HTML parser.
Diffstat (limited to 'Libraries/LibCore/MimeData.cpp')
-rw-r--r--Libraries/LibCore/MimeData.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/Libraries/LibCore/MimeData.cpp b/Libraries/LibCore/MimeData.cpp
index ffc9a698b3..02a4d49b88 100644
--- a/Libraries/LibCore/MimeData.cpp
+++ b/Libraries/LibCore/MimeData.cpp
@@ -87,6 +87,8 @@ String guess_mime_type_based_on_filename(const URL& url)
return "image/bmp";
if (lowercase_url.ends_with(".jpg") || lowercase_url.ends_with(".jpeg"))
return "image/jpeg";
+ if (lowercase_url.ends_with(".svg"))
+ return "image/svg+xml";
if (lowercase_url.ends_with(".md"))
return "text/markdown";
if (lowercase_url.ends_with(".html") || lowercase_url.ends_with(".htm"))