Sha256: 9e2fc0a258205f823fbf1e021b1a6f5979ebf50afb2f680bab68459ae71e58af

Contents?: true

Size: 740 Bytes

Versions: 94

Compression:

Stored size: 740 Bytes

Contents

require 'net/http'

## monkey-patch Net::HTTP
#
# Certain apple endpoints return 415 responses if a Content-Type is supplied.
# Net::HTTP will default a content-type if none is provided by faraday
# This monkey-patch allows us to leave out the content-type if we do not specify one.
module NetHTTPGenericRequestMonkeypatch
  def supply_default_content_type
    # Return no content type if we communicating with an apple.com domain
    return if !self['host'].nil? && self['host'].end_with?('.apple.com')

    # Otherwise use the default implementation
    super
  end
end

# We prepend the monkeypatch so the patch has access to the original implementation
# using `super`.
Net::HTTPGenericRequest.prepend(NetHTTPGenericRequestMonkeypatch)

Version data entries

94 entries across 94 versions & 4 rubygems

Version Path
fastlane-2.225.0 spaceship/lib/spaceship/helper/net_http_generic_request.rb
fastlane-2.224.0 spaceship/lib/spaceship/helper/net_http_generic_request.rb
fastlane-2.223.1 spaceship/lib/spaceship/helper/net_http_generic_request.rb
fastlane-2.223.0 spaceship/lib/spaceship/helper/net_http_generic_request.rb
fastlane-2.222.0 spaceship/lib/spaceship/helper/net_http_generic_request.rb
fastlane-2.221.1 spaceship/lib/spaceship/helper/net_http_generic_request.rb
fastlane-2.221.0 spaceship/lib/spaceship/helper/net_http_generic_request.rb
fastlane-2.220.0 spaceship/lib/spaceship/helper/net_http_generic_request.rb
fastlane-2.219.0 spaceship/lib/spaceship/helper/net_http_generic_request.rb
fastlane-2.218.0 spaceship/lib/spaceship/helper/net_http_generic_request.rb
fastlane-security-patched-2.216.0 spaceship/lib/spaceship/helper/net_http_generic_request.rb
fastlane-2.217.0 spaceship/lib/spaceship/helper/net_http_generic_request.rb
fastlane-2.216.0 spaceship/lib/spaceship/helper/net_http_generic_request.rb
fastlane-2.215.1 spaceship/lib/spaceship/helper/net_http_generic_request.rb
fastlane-2.215.0 spaceship/lib/spaceship/helper/net_http_generic_request.rb
fastlane-mercafacil-2.214.0 spaceship/lib/spaceship/helper/net_http_generic_request.rb
fastlane-2.214.0 spaceship/lib/spaceship/helper/net_http_generic_request.rb
fastlane-2.213.0 spaceship/lib/spaceship/helper/net_http_generic_request.rb
fastlane-2.212.2 spaceship/lib/spaceship/helper/net_http_generic_request.rb
fastlane_pricing_fix-2.212.1 spaceship/lib/spaceship/helper/net_http_generic_request.rb