Skip to content

Commit

Permalink
Merge pull request #42 from miyataka/fix/ci
Browse files Browse the repository at this point in the history
  • Loading branch information
miyataka authored Dec 27, 2023
2 parents 89619de + 3a02444 commit 4add700
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
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 4add700

Please sign in to comment.