From 0d7aa9893f648d834a3186aa491714cd12414ae2 Mon Sep 17 00:00:00 2001 From: yggverse Date: Sun, 18 Aug 2024 16:06:22 +0300 Subject: [PATCH] add mime type detection by path extension --- src/app/browser/main/tab/page.cpp | 4 ++-- src/app/browser/main/tab/page.hpp | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/app/browser/main/tab/page.cpp b/src/app/browser/main/tab/page.cpp index 8b72e22d..67254a63 100644 --- a/src/app/browser/main/tab/page.cpp +++ b/src/app/browser/main/tab/page.cpp @@ -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 diff --git a/src/app/browser/main/tab/page.hpp b/src/app/browser/main/tab/page.hpp index 7b085ee3..ab1fdd37 100644 --- a/src/app/browser/main/tab/page.hpp +++ b/src/app/browser/main/tab/page.hpp @@ -10,6 +10,7 @@ #include #include #include +#include #include #include