Browse Source

add mime type detection by path extension

CPP-GTK4
yggverse 3 months ago
parent
commit
0d7aa9893f
  1. 4
      src/app/browser/main/tab/page.cpp
  2. 1
      src/app/browser/main/tab/page.hpp

4
src/app/browser/main/tab/page.cpp

@ -110,8 +110,8 @@ void Page::update() @@ -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

1
src/app/browser/main/tab/page.hpp

@ -10,6 +10,7 @@ @@ -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>

Loading…
Cancel
Save