Skip to content

Commit

Permalink
fix: match lowercase content-type header
Browse files Browse the repository at this point in the history
  • Loading branch information
disrupted authored and NTBBloodbath committed Apr 17, 2024
1 parent 2ca87d3 commit 20c5b52
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lua/rest-nvim/result/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ local function format_body(bufnr, headers, res)
---@type string
local res_type
for _, header in ipairs(headers) do
if header:find("^Content%-Type") then
if header:lower():find("^content%-type") then
local content_type = vim.trim(vim.split(header, ":")[2])
-- We need to remove the leading charset if we are getting a JSON
res_type = vim.split(content_type, "/")[2]:gsub(";.*", "")
Expand Down

0 comments on commit 20c5b52

Please sign in to comment.