From c46485f9d37349681b90517bd5a33304af8dee7e Mon Sep 17 00:00:00 2001 From: Daniele Teti Date: Sat, 25 Apr 2020 15:24:08 +0200 Subject: [PATCH] Added support for MIME: csv, text, jpe, svg, svgz, gif --- samples/winecellarserver/www/pics/svglogo.svg | 261 ++++++++++++++++++ sources/MVCFramework.Commons.pas | 2 + sources/MVCFramework.pas | 6 + 3 files changed, 269 insertions(+) create mode 100644 samples/winecellarserver/www/pics/svglogo.svg diff --git a/samples/winecellarserver/www/pics/svglogo.svg b/samples/winecellarserver/www/pics/svglogo.svg new file mode 100644 index 00000000..fea45882 --- /dev/null +++ b/samples/winecellarserver/www/pics/svglogo.svg @@ -0,0 +1,261 @@ + + + + + SVG Logo + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + SVG + + + + + + + + diff --git a/sources/MVCFramework.Commons.pas b/sources/MVCFramework.Commons.pas index 62863538..c3640fc9 100644 --- a/sources/MVCFramework.Commons.pas +++ b/sources/MVCFramework.Commons.pas @@ -76,6 +76,8 @@ type IMAGE_X_PNG = 'image/x-png'; IMAGE_X_ICON = 'image/x-icon'; IMAGE_PNG = 'image/png'; + IMAGE_SVG_XML = 'image/svg+xml'; + IMAGE_GIF = 'image/gif'; APPLICATION_PDF = 'application/pdf'; APPLICATION_X_PDF = 'application/x-pdf'; WILDCARD = '*/*'; diff --git a/sources/MVCFramework.pas b/sources/MVCFramework.pas index 96dd5815..ceb53122 100644 --- a/sources/MVCFramework.pas +++ b/sources/MVCFramework.pas @@ -1961,13 +1961,19 @@ begin FMediaTypes.Add('.html', TMVCMediaType.TEXT_HTML); FMediaTypes.Add('.htm', TMVCMediaType.TEXT_HTML); FMediaTypes.Add('.txt', TMVCMediaType.TEXT_PLAIN); + FMediaTypes.Add('.text', TMVCMediaType.TEXT_PLAIN); + FMediaTypes.Add('.csv', TMVCMediaType.TEXT_CSV); FMediaTypes.Add('.css', TMVCMediaType.TEXT_CSS); FMediaTypes.Add('.js', TMVCMediaType.TEXT_JAVASCRIPT); FMediaTypes.Add('.jpg', TMVCMediaType.IMAGE_JPEG); FMediaTypes.Add('.jpeg', TMVCMediaType.IMAGE_JPEG); + FMediaTypes.Add('.jpe', TMVCMediaType.IMAGE_JPEG); FMediaTypes.Add('.png', TMVCMediaType.IMAGE_PNG); FMediaTypes.Add('.ico', TMVCMediaType.IMAGE_X_ICON); FMediaTypes.Add('.appcache', TMVCMediaType.TEXT_CACHEMANIFEST); + FMediaTypes.Add('.svg', TMVCMediaType.IMAGE_SVG_XML); + FMediaTypes.Add('.svgz', TMVCMediaType.IMAGE_SVG_XML); + FMediaTypes.Add('.gif',TMVCMediaType.IMAGE_GIF); Log.Info('EXIT: Config default values', LOGGERPRO_TAG);