We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 1ddcc92 commit 91badd4Copy full SHA for 91badd4
lua/rest-nvim/curl/init.lua
@@ -133,7 +133,13 @@ local function create_callback(curl_cmd, opts)
133
134
local content_type = res.headers[utils.key(res.headers, "content-type")]
135
if content_type then
136
- content_type = content_type:match("application/([-a-z]+)") or content_type:match("text/(%l+)")
+ local isJson = content_type:match("application/.+(json)")
137
+
138
+ if isJson then
139
+ content_type = "json"
140
+ else
141
+ content_type = content_type:match("application/([-a-z]+)") or content_type:match("text/(%l+)")
142
+ end
143
end
144
145
if script_str ~= nil then
0 commit comments