File tree Expand file tree Collapse file tree 2 files changed +4
-3
lines changed
Expand file tree Collapse file tree 2 files changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -126,7 +126,8 @@ local function get_headers(bufnr, query_line)
126126 end
127127
128128 for _ , next_line_content in pairs (next_line ) do
129- if string.find (next_line_content , ' {' ) then
129+ -- If the next line starts the request body then break the loop
130+ if next_line_content :find (' ^{' ) then
130131 break_loops = true
131132 break
132133 else
Original file line number Diff line number Diff line change 3232M .replace_env_vars = function (str )
3333 local env_vars = M .read_env_file ()
3434
35- for var in string.gmatch (str , ' {{%w +}}' ) do
35+ for var in string.gmatch (str , ' {{[%w%W] +}}' ) do
3636 var = var :gsub (' {' , ' ' ):gsub (' }' , ' ' )
3737 -- If the env variable wasn't found in the `.env` file then search it
3838 -- in the OS environment variables
3939 if M .has_key (env_vars , var ) then
4040 str = str :gsub (' {{' .. var .. ' }}' , env_vars [var ])
4141 else
42- if os.getenv (var ) ~= nil then
42+ if os.getenv (var ) then
4343 str = str :gsub (' {{' .. var .. ' }}' , os.getenv (var ))
4444 else
4545 error (
You can’t perform that action at this time.
0 commit comments