Skip to content

Commit

Permalink
fix: guess correct filetype from vnd.api+json style content-type
Browse files Browse the repository at this point in the history
fix #382
  • Loading branch information
boltlessengineer committed Dec 28, 2024
1 parent a52b83b commit 576f8e6
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions lua/rest-nvim/ui/result.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 576f8e6

Please sign in to comment.