Skip to content

Commit 20c5b52

Browse files
disruptedNTBBloodbath
authored andcommitted
fix: match lowercase content-type header
1 parent 2ca87d3 commit 20c5b52

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lua/rest-nvim/result/init.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@ local function format_body(bufnr, headers, res)
192192
---@type string
193193
local res_type
194194
for _, header in ipairs(headers) do
195-
if header:find("^Content%-Type") then
195+
if header:lower():find("^content%-type") then
196196
local content_type = vim.trim(vim.split(header, ":")[2])
197197
-- We need to remove the leading charset if we are getting a JSON
198198
res_type = vim.split(content_type, "/")[2]:gsub(";.*", "")

0 commit comments

Comments
 (0)