diff --git a/src/WebResponses.cpp b/src/WebResponses.cpp index 2f54e7426..a8b69f617 100644 --- a/src/WebResponses.cpp +++ b/src/WebResponses.cpp @@ -662,6 +662,10 @@ void AsyncFileResponse::_setContentTypeFromPath(const String &path) { _contentType = T_image_svg_xml; } else if (strcmp(dot, T__jpg) == 0) { _contentType = T_image_jpeg; + } else if (strcmp(dot, T__webp) == 0) { + _contentType = T_image_webp; + } else if (strcmp(dot, T__avif) == 0) { + _contentType = T_image_avif; } else if (strcmp(dot, T__gif) == 0) { _contentType = T_image_gif; } else if (strcmp(dot, T__woff2) == 0) { diff --git a/src/literals.h b/src/literals.h index b3ea800d5..0b3c80035 100644 --- a/src/literals.h +++ b/src/literals.h @@ -106,6 +106,7 @@ static constexpr const char *T_RCT_EVENT = "RCT_EVENT"; static constexpr const char *T_ERROR = "ERROR"; // extensions & MIME-Types +static constexpr const char *T__avif = ".avif"; static constexpr const char *T__css = ".css"; static constexpr const char *T__eot = ".eot"; static constexpr const char *T__gif = ".gif"; @@ -120,6 +121,7 @@ static constexpr const char *T__pdf = ".pdf"; static constexpr const char *T__png = ".png"; static constexpr const char *T__svg = ".svg"; static constexpr const char *T__ttf = ".ttf"; +static constexpr const char *T__webp = ".webp"; static constexpr const char *T__woff = ".woff"; static constexpr const char *T__woff2 = ".woff2"; static constexpr const char *T__xml = ".xml"; @@ -134,10 +136,12 @@ static constexpr const char *T_font_eot = "font/eot"; static constexpr const char *T_font_ttf = "font/ttf"; static constexpr const char *T_font_woff = "font/woff"; static constexpr const char *T_font_woff2 = "font/woff2"; +static constexpr const char *T_image_avif = "image/avif"; static constexpr const char *T_image_gif = "image/gif"; static constexpr const char *T_image_jpeg = "image/jpeg"; static constexpr const char *T_image_png = "image/png"; static constexpr const char *T_image_svg_xml = "image/svg+xml"; +static constexpr const char *T_image_webp = "image/webp"; static constexpr const char *T_image_x_icon = "image/x-icon"; static constexpr const char *T_text_css = "text/css"; static constexpr const char *T_text_event_stream = "text/event-stream";