diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 4e6b2bb..bb126e3 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -21,9 +21,9 @@ jobs: - name: Configure Bundler run: | ruby -v - gem update --system + # gem update --system gem --version - gem install -N bundler + gem install -N bundler -v 2.4 - uses: actions/cache@v3 with: diff --git a/lib/fcmpush/client.rb b/lib/fcmpush/client.rb index b953288..b815b39 100644 --- a/lib/fcmpush/client.rb +++ b/lib/fcmpush/client.rb @@ -26,7 +26,11 @@ 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 != '' @@ -34,8 +38,6 @@ def initialize(domain, project_id, configuration, **options) uri.password = configuration.proxy[:password] if configuration.proxy[:password] end @connection.proxy = uri - elsif configuration.proxy != false - @connection.proxy = :ENV end end