File tree 2 files changed +4
-3
lines changed
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)
126
126
end
127
127
128
128
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
130
131
break_loops = true
131
132
break
132
133
else
Original file line number Diff line number Diff line change 32
32
M .replace_env_vars = function (str )
33
33
local env_vars = M .read_env_file ()
34
34
35
- for var in string.gmatch (str , ' {{%w +}}' ) do
35
+ for var in string.gmatch (str , ' {{[%w%W] +}}' ) do
36
36
var = var :gsub (' {' , ' ' ):gsub (' }' , ' ' )
37
37
-- If the env variable wasn't found in the `.env` file then search it
38
38
-- in the OS environment variables
39
39
if M .has_key (env_vars , var ) then
40
40
str = str :gsub (' {{' .. var .. ' }}' , env_vars [var ])
41
41
else
42
- if os.getenv (var ) ~= nil then
42
+ if os.getenv (var ) then
43
43
str = str :gsub (' {{' .. var .. ' }}' , os.getenv (var ))
44
44
else
45
45
error (
You can’t perform that action at this time.
0 commit comments