Skip to content

Commit 68817b4

Browse files
Merge branch 'main' into feature/title-case-http-headers
2 parents 6a038f1 + 7a8fa42 commit 68817b4

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

src/WebResponses.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -662,6 +662,10 @@ void AsyncFileResponse::_setContentTypeFromPath(const String &path) {
662662
_contentType = T_image_svg_xml;
663663
} else if (strcmp(dot, T__jpg) == 0) {
664664
_contentType = T_image_jpeg;
665+
} else if (strcmp(dot, T__webp) == 0) {
666+
_contentType = T_image_webp;
667+
} else if (strcmp(dot, T__avif) == 0) {
668+
_contentType = T_image_avif;
665669
} else if (strcmp(dot, T__gif) == 0) {
666670
_contentType = T_image_gif;
667671
} else if (strcmp(dot, T__woff2) == 0) {

src/literals.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,7 @@ static constexpr const char *T_RCT_EVENT = "RCT_EVENT";
103103
static constexpr const char *T_ERROR = "ERROR";
104104

105105
// extensions & MIME-Types
106+
static constexpr const char *T__avif = ".avif";
106107
static constexpr const char *T__css = ".css";
107108
static constexpr const char *T__eot = ".eot";
108109
static constexpr const char *T__gif = ".gif";
@@ -117,6 +118,7 @@ static constexpr const char *T__pdf = ".pdf";
117118
static constexpr const char *T__png = ".png";
118119
static constexpr const char *T__svg = ".svg";
119120
static constexpr const char *T__ttf = ".ttf";
121+
static constexpr const char *T__webp = ".webp";
120122
static constexpr const char *T__woff = ".woff";
121123
static constexpr const char *T__woff2 = ".woff2";
122124
static constexpr const char *T__xml = ".xml";
@@ -132,10 +134,12 @@ static constexpr const char *T_font_eot = "font/eot";
132134
static constexpr const char *T_font_ttf = "font/ttf";
133135
static constexpr const char *T_font_woff = "font/woff";
134136
static constexpr const char *T_font_woff2 = "font/woff2";
137+
static constexpr const char *T_image_avif = "image/avif";
135138
static constexpr const char *T_image_gif = "image/gif";
136139
static constexpr const char *T_image_jpeg = "image/jpeg";
137140
static constexpr const char *T_image_png = "image/png";
138141
static constexpr const char *T_image_svg_xml = "image/svg+xml";
142+
static constexpr const char *T_image_webp = "image/webp";
139143
static constexpr const char *T_image_x_icon = "image/x-icon";
140144
static constexpr const char *T_text_css = "text/css";
141145
static constexpr const char *T_text_event_stream = "text/event-stream";

0 commit comments

Comments
 (0)