Correctly initialise WebPush connection (#2417)

The `ipaddr` arg here is being interpreted as a positional arg (since
the keyword arg doesn't exist), which results in an invalid connection
object. This was causing push notifications to silently fail.

We should initialise the property on the object instead.
This commit is contained in:
Kevin McConnell
2026-01-22 20:03:02 +00:00
committed by GitHub
parent 8ba6a97014
commit 23fe40fa81
4 changed files with 73 additions and 1 deletions
+2 -1
View File
@@ -20,7 +20,8 @@ module WebPush::PersistentRequest
endpoint_ip = @options[:endpoint_ip]
if endpoint_ip
http = Net::HTTP.new(uri.host, uri.port, ipaddr: endpoint_ip)
http = Net::HTTP.new(uri.host, uri.port)
http.ipaddr = endpoint_ip
http.use_ssl = true
http.ssl_timeout = @options[:ssl_timeout] unless @options[:ssl_timeout].nil?
http.open_timeout = @options[:open_timeout] unless @options[:open_timeout].nil?