Skip to content

Commit

Permalink
Update lua/hurl/utils.lua
Browse files Browse the repository at this point in the history
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
  • Loading branch information
jellydn and coderabbitai[bot] authored Oct 16, 2024
1 parent d4dffb6 commit f817207
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions lua/hurl/utils.lua
Original file line number Diff line number Diff line change
Expand Up @@ -321,13 +321,8 @@ util.get_url_from_hurl_file = function(file_path)
for line in file:lines() do
line = line:gsub('^%s*(.-)%s*$', '%1')
line = line:gsub('%s+', ' ')
-- NOTE: somehow i can not make regex work here
local matchcase = string.find(line, 'GET ')
or string.find(line, 'POST ')
or string.find(line, 'PUT ')
or string.find(line, 'DELETE ')
or string.find(line, 'PATCH ')
if matchcase then
local method = line:match('^(%u+)%s')
if method and method:match('^(GET|POST|PUT|DELETE|PATCH)$') then
file:close()
return line
end
Expand Down

0 comments on commit f817207

Please sign in to comment.