File tree Expand file tree Collapse file tree 2 files changed +3
-16
lines changed Expand file tree Collapse file tree 2 files changed +3
-16
lines changed Original file line number Diff line number Diff line change @@ -91,20 +91,7 @@ parse.headers = function(t)
91
91
if not t then
92
92
return
93
93
end
94
- local upper = function (str )
95
- return string.gsub (" " .. str , " %W%l" , string.upper ):sub (2 )
96
- end
97
- return util .kv_to_list (
98
- (function ()
99
- local normilzed = {}
100
- for k , v in pairs (t ) do
101
- normilzed [upper (k :gsub (" _" , " %-" ))] = v
102
- end
103
- return normilzed
104
- end )(),
105
- " -H" ,
106
- " : "
107
- )
94
+ return util .kv_to_list (t , " -H" , " : " )
108
95
end
109
96
110
97
parse .data_body = function (t )
Original file line number Diff line number Diff line change @@ -145,7 +145,7 @@ describe("CURL Wrapper:", function()
145
145
local res = curl .post (" https://postman-echo.com/post" , {
146
146
body = vim .fn .json_encode (json ),
147
147
headers = {
148
- content_type = " application/json" ,
148
+ [ " content-type " ] = " application/json" ,
149
149
},
150
150
}).body
151
151
eq (json , vim .fn .json_decode (res ).json )
@@ -157,7 +157,7 @@ describe("CURL Wrapper:", function()
157
157
local res = curl .post (" https://postman-echo.com/post" , {
158
158
body = body ,
159
159
headers = {
160
- content_type = " application/json" ,
160
+ [ " content-type " ] = " application/json" ,
161
161
},
162
162
dry_run = true ,
163
163
})
You can’t perform that action at this time.
0 commit comments