add mime type detection by path extension

This commit is contained in:
yggverse 2024-08-18 16:06:22 +03:00
parent 30e3ae691a
commit 0d7aa9893f
2 changed files with 3 additions and 2 deletions

View File

@ -110,8 +110,8 @@ void Page::update()
// Route by status code
if (meta[1] == "20")
{
// Route by mime type
if (meta[2] == "text/gemini")
// Route by mime type or path extension
if (meta[2] == "text/gemini" || Glib::str_has_suffix(navbar->get_request_path(), ".gmi"))
{
content->text_gemini(
buffer // @TODO

View File

@ -10,6 +10,7 @@
#include <glibmm/i18n.h>
#include <glibmm/refptr.h>
#include <glibmm/regex.h>
#include <glibmm/stringutils.h>
#include <glibmm/ustring.h>
#include <gtkmm/box.h>