File tree Expand file tree Collapse file tree 2 files changed +8
-2
lines changed
Expand file tree Collapse file tree 2 files changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -161,10 +161,14 @@ end
161161-- @param stmt the request statement, e.g., POST http://localhost:3000/foo
162162local function parse_url (stmt )
163163 local parsed = utils .split (stmt , " " )
164+ local http_method = parsed [1 ]
165+ table.remove (parsed , 1 )
166+ local target_url = table.concat (parsed , " " )
167+
164168 return {
165- method = parsed [ 1 ] ,
169+ method = http_method ,
166170 -- Encode URL
167- url = utils .encode_url (utils .replace_vars (parsed [ 2 ] )),
171+ url = utils .encode_url (utils .replace_vars (target_url )),
168172 }
169173end
170174
Original file line number Diff line number Diff line change 140140-- @param str Where replace the placers for the env variables
141141M .replace_vars = function (str )
142142 local vars = M .read_variables ()
143+ -- remove $dotenv tags, which are used by the vscode rest client for cross compatibility
144+ str = str :gsub (" %$dotenv " , " " ):gsub (" %$DOTENV " , " " )
143145
144146 for var in string.gmatch (str , " {{[^}]+}}" ) do
145147 var = var :gsub (" {" , " " ):gsub (" }" , " " )
You can’t perform that action at this time.
0 commit comments