Rest api query should not crash if headers not defined

This commit is contained in:
navaneeth 2021-05-22 12:29:36 +05:30
parent ced5bf2868
commit 589a2fff9e

View file

@ -12,7 +12,7 @@ class RestapiQueryService
def process
url = options['url']
method = options['method']
headers = options['headers'].reject { |header| header[0].empty? }
headers = (options['headers'] || []).reject { |header| header[0].empty? }
headers = headers.to_h
body = options['body']
url_params = options['url_params']