diff options
author | Rodrigo Arias Mallo <rodarima@gmail.com> | 2024-04-25 21:09:50 +0200 |
---|---|---|
committer | Rodrigo Arias Mallo <rodarima@gmail.com> | 2024-04-26 22:56:28 +0200 |
commit | d9c506df8528c2db84d724048f9bc578605f9a3f (patch) | |
tree | 3f416c1e0575b1cabd05fa1d4647e252ca56207c /dpi/file.c | |
parent | d10b35011731b4660e7b796b1e19a44144c63a3c (diff) |
Recognize *.xhtml documents as HTML too
The file plugin was not able to detect XHTML documents from files with
the .xhtml extension if there are comments before the doctype line.
Before falling back to reading the content, we directly specify the
media type to HTML based on the extension alone.
The basic content type detection algorithm is too simple and will
continue to fail when comments are placed before the doctype line.
Reported-by: Kevin Koster <dillo@ombertech.com>
See: https://lists.mailman3.com/hyperkitty/list/dillo-dev@mailman3.com/message/HBKXGO7EGCHWOQ6BM55A4LZQKT437UID/
Diffstat (limited to 'dpi/file.c')
-rw-r--r-- | dpi/file.c | 1 |
1 files changed, 1 insertions, 0 deletions
@@ -511,6 +511,7 @@ static const char *File_ext(const char *filename) } else if (!dStrAsciiCasecmp(e, "png")) { return "image/png"; } else if (!dStrAsciiCasecmp(e, "html") || + !dStrAsciiCasecmp(e, "xhtml") || !dStrAsciiCasecmp(e, "htm") || !dStrAsciiCasecmp(e, "shtml")) { return "text/html"; |