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)
9191 if not t then
9292 return
9393 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" , " : " )
10895end
10996
11097parse .data_body = function (t )
Original file line number Diff line number Diff line change @@ -145,7 +145,7 @@ describe("CURL Wrapper:", function()
145145 local res = curl .post (" https://postman-echo.com/post" , {
146146 body = vim .fn .json_encode (json ),
147147 headers = {
148- content_type = " application/json" ,
148+ [ " content-type " ] = " application/json" ,
149149 },
150150 }).body
151151 eq (json , vim .fn .json_decode (res ).json )
@@ -157,7 +157,7 @@ describe("CURL Wrapper:", function()
157157 local res = curl .post (" https://postman-echo.com/post" , {
158158 body = body ,
159159 headers = {
160- content_type = " application/json" ,
160+ [ " content-type " ] = " application/json" ,
161161 },
162162 dry_run = true ,
163163 })
You can’t perform that action at this time.
0 commit comments