Created
May 9, 2014 15:07
-
-
Save julik/319e391513df750cb9fe to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This line makes me sad | |
Faraday::Adapter.register_middleware File.expand_path(File.dirname(__FILE__)), | |
:certificate_pinning => [:CertificatePinning, 'certificate_pinning/certificate_pinning'] | |
Faraday.new(:url => 'https://fancy-startup.io/api') do |f| | |
f.use :http_cache, store: @cache | |
f.request :url_encoded | |
f.response :logger | |
f.adapter :certificate_pinning # I want to use my custom Adapter subclass here | |
end |
Tried it first, but I don't have namespaces.
require_relative 'certificate_pinning/certificate_pinning'
Faraday.new(:url => 'https://shotsky.io') do |f|
f.use :http_cache, store: @cache
f.request :url_encoded
f.response :logger
f.adapter CertificatePinning
end
"CertificatePinning is not registered on Faraday::Adapter"
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
How about this?