Skip to content

Commit

Permalink
fix: ci
Browse files Browse the repository at this point in the history
  • Loading branch information
miyataka committed Dec 27, 2023
1 parent 5896642 commit fe0cd9b
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions lib/fcmpush/client.rb
Original file line number Diff line number Diff line change
Expand Up @@ -26,16 +26,18 @@ def initialize(domain, project_id, configuration, **options)
@server_key = configuration.server_key
@connection = Net::HTTP::Persistent.new

if configuration.proxy && configuration.proxy[:uri]
if !configuration.proxy
# do nothing
elsif configuration.proxy == :ENV
@connection.proxy = :ENV
elsif configuration.proxy && configuration.proxy[:uri]
uri = URI(configuration.proxy[:uri])
# user name must not be a empty string, password can
if configuration.proxy[:user] && configuration.proxy[:user].strip != ''
uri.user = configuration.proxy[:user]
uri.password = configuration.proxy[:password] if configuration.proxy[:password]
end
@connection.proxy = uri
elsif configuration.proxy != false
@connection.proxy = :ENV
end
end

Expand Down

0 comments on commit fe0cd9b

Please sign in to comment.