Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue6765 proxy #6817

Merged
merged 3 commits into from
Nov 2, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
10 changes: 8 additions & 2 deletions fastlane/lib/fastlane/helper/crashlytics_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,14 @@ def download_android_tools
begin
UI.important("Downloading Crashlytics Support Library - this might take a minute...")

result = Net::HTTP.get(URI(url))
File.write(zip_path, result)
# Work around ruby defect, where HTTP#get_response and HTTP#post_form don't use ENV proxy settings
# https://bugs.ruby-lang.org/issues/12724
uri = URI(url)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be nice to mention (with a link to the ruby issue) why it is done that way in a comment. Otherwise someone might come along later, wonder why it is done this way, and change it back.

http_conn = Net::HTTP.new(uri.host, uri.port)
http_conn.use_ssl = true
result = http_conn.request_get(uri.path)
UI.error! "#{result.message} (#{result.code})" unless result.kind_of? Net::HTTPSuccess
File.write(zip_path, result.body)

# Now unzip the file
Action.sh "unzip '#{zip_path}' -d '#{containing}'"
Expand Down