Method: Fastlane::Actions::HockeyAction.connection

Defined in:
fastlane/lib/fastlane/actions/hockey.rb

.connection(options) ⇒ Object



10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
# File 'fastlane/lib/fastlane/actions/hockey.rb', line 10

def self.connection(options)
  require 'faraday'
  require 'faraday_middleware'

  base_url = options.delete(:bypass_cdn) ? "https://rink.hockeyapp.net" : "https://upload.hockeyapp.net"
  foptions = {
    url: base_url
  }
  Faraday.new(foptions) do |builder|
    builder.request(:multipart)
    builder.request(:url_encoded)
    builder.response(:json, content_type: /\bjson$/)
    builder.use(FaradayMiddleware::FollowRedirects)
    builder.adapter(:net_http)
  end
end