@@ -85,7 +85,7 @@ local function get_body(bufnr, stop_line, query_line, json_body)
8585
8686 for _ , json_line in ipairs (json_lines ) do
8787 -- Ignore commented lines with and without indent
88- if not (json_line : find ( ' ^# ' ) or json_line : find ( ' ^%s+# ' ) ) then
88+ if not utils . contains_comments (json_line ) then
8989 json_string = json_string .. utils .replace_env_vars (json_line )
9090 end
9191 end
@@ -148,7 +148,7 @@ local function get_headers(bufnr, query_line)
148148 and not header [1 ]:find (' ^%s+"' )
149149 -- If header key doesn't contains hashes,
150150 -- so we don't get commented headers
151- and not (header [1 ]: find ( ' ^# ' ) or header [ 1 ]: find ( ' ^%s+# ' ) )
151+ and not utils . contains_comments (header [1 ])
152152 -- If header key doesn't contains HTTP methods,
153153 -- so we don't get the http method/url
154154 and not utils .has_value (http_methods , header [1 ])
@@ -188,7 +188,7 @@ local function get_accept(bufnr, query_line)
188188
189189 for _ , accept_data in pairs (accept_line ) do
190190 -- Ignore commented lines with and without indent
191- if not (accept_data : find ( ' ^# ' ) or accept_data : find ( ' (^%s+#) ' ) ) then
191+ if not utils . contains_comments (accept_data ) then
192192 accept = utils .split (accept_data , ' :' )[2 ]
193193 end
194194 end
0 commit comments