commit eddd8af47e63726017aca9a088f4de0740033699 from: Aleksey Ryndin date: Thu Apr 11 10:12:17 2024 UTC Fix: Providing a MIME type for status 20 responses is now mandatory gemini://geminiprotocol.net/news/2024_03_31.gmi commit - 4de87cb0c619d0f55af39fc828fb744f62cebf2f commit + eddd8af47e63726017aca9a088f4de0740033699 blob - 5523241a2da909a0eb343c9dcfcf1bfc999b9e49 blob + 15ab6a18586dacba22d08d61f062ca0c066aa595 --- vostok/vostok.cc +++ vostok/vostok.cc @@ -23,7 +23,7 @@ namespace namespace meta { -const std::string _EMPTY; +const std::string TEXT_GEMINI{"text/gemini"}; const std::string BAD_REQUEST{"Bad request"}; const std::string URL_TOO_SHORT{"URL is too short"}; const std::string NON_GEMINI{"No proxying to non-Gemini content"}; @@ -138,9 +138,9 @@ void client_thread(const transport::AcceptedClient *ac break; } - // > If is an empty string, the MIME type MUST default to "text/gemini; charset=utf-8". + // from mime.types or "text/gemini" (default). const auto _mime_type = mime.lookup(*opened_path); - const std::string &meta_string = _mime_type ? *_mime_type : meta::_EMPTY; + const std::string &meta_string = _mime_type ? *_mime_type : meta::TEXT_GEMINI; send_response(accepted_client->get_ctx(), gemini::STATUS_20_SUCCESS, meta_string); std::vector buffer;