When Net::HTTP::Post is being instantiated only the uri.path was being passed (#924)

fixed bug causing webhook not to trigger unless query params were present
This commit is contained in:
Mark Rodgers
2019-12-05 17:21:07 +00:00
committed by Adam Cooke
parent 7cfbda4426
commit d067944301
+1 -1
View File
@@ -15,7 +15,7 @@ module Postal
def self.request(method, url, options = {}) def self.request(method, url, options = {})
options[:headers] ||= {} options[:headers] ||= {}
uri = URI.parse(url) uri = URI.parse(url)
request = method.new(uri.path.length == 0 ? "/" : uri.path) request = method.new((uri.path.length == 0 ? "/" : uri.path) + (uri.query ? "?" + uri.query : ""))
options[:headers].each { |k,v| request.add_field k, v } options[:headers].each { |k,v| request.add_field k, v }
if options[:username] || uri.user if options[:username] || uri.user