From 576f8e6a40345f51f7bdb12f5df2be0382f7d6ca Mon Sep 17 00:00:00 2001 From: Seongmin Lee Date: Sat, 28 Dec 2024 18:05:46 +0000 Subject: [PATCH] fix: guess correct filetype from `vnd.api+json` style content-type fix #382 --- lua/rest-nvim/ui/result.lua | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lua/rest-nvim/ui/result.lua b/lua/rest-nvim/ui/result.lua index d019b52..eed5197 100644 --- a/lua/rest-nvim/ui/result.lua +++ b/lua/rest-nvim/ui/result.lua @@ -78,6 +78,8 @@ local panes = { local body_meta = {} if content_type then local base_type, res_type = content_type[1]:match("(.*)/([^;]+)") + -- HACK: handle application/vnd.api+json style content types + res_type = res_type:match(".+%+(.*)") or res_type if base_type == "image" then body = { "Binary(image) answer" } elseif res_type == "octet_stream" then -- 2.51.2