Skip to content

Commit

Permalink
Listen to APPSIGNAL_HTTP_PROXY in installer (#1066)
Browse files Browse the repository at this point in the history
Other than the Ruby gem config, HTTP_PROXY and http_proxy env vars, also
listen to our own env var APPSIGNAL_HTTP_PROXY so people who use that
env var, don't also need to add another configuration.

Closes #787
  • Loading branch information
tombruijn authored Apr 26, 2024
1 parent 5758daf commit ccfa357
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
bump: "patch"
type: "change"
---

Listen to the `APPSIGNAL_HTTP_PROXY` environment variable in the extension installer. When `APPSIGNAL_HTTP_PROXY` is set during `gem instal appsignal` or `bundle install`, it will use the proxy specified in the `APPSIGNAL_HTTP_PROXY` environment variable to download the extension and agent.
3 changes: 3 additions & 0 deletions ext/base.rb
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,9 @@ def store_download_version_on_report
end

def http_proxy
proxy = try_http_proxy_value(ENV.fetch("APPSIGNAL_HTTP_PROXY", nil))
return [proxy, nil] if proxy

proxy, error =
begin
[try_http_proxy_value(Gem.configuration[:http_proxy]), nil]
Expand Down

0 comments on commit ccfa357

Please sign in to comment.