Skip to content

Commit 9e5cc01

Browse files
committed
ContentTypes: Fix lastIndexOf check
1 parent 6bf93e9 commit 9e5cc01

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/ContentTypes.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ static inline bool matches_p(const char* str, const char* progmem_str) {
77
const __FlashStringHelper* contentTypeFor(const String& path) {
88
// Find extension part of path
99
auto idx = path.lastIndexOf('.');
10-
if (idx < path.length()) {
10+
if (idx >= 0) {
1111
auto ext_str = path.begin() + idx + 1;
1212

1313
if (matches_p(ext_str, HTML_EXTENSION)) return FPSTR(CONTENT_TYPE_HTML);

0 commit comments

Comments
 (0)