Sha256: 27ab3b6e80c6f17b4e54c99a1d84501be90d2f515b54c69fcaa98d1b025bd6ad

Contents?: true

Size: 506 Bytes

Versions: 14

Compression:

Stored size: 506 Bytes

Contents

# frozen_string_literal: true

require 'faraday'

module Mock
  module Twilio
    module Middleware
      class Proxy < Faraday::Middleware
        def initialize(app)
          super(app)
        end

        def call(env)
          env.url.host = env.request.proxy.host
          env.url.port = env.request.proxy.port
          env.url.scheme = env.request.proxy.scheme
          super
        end
      end
    end
  end
end

Faraday::Request.register_middleware(proxy: Mock::Twilio::Middleware::Proxy)

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
mock-twilio-1.3.0 lib/mock/twilio/middleware/proxy.rb
mock-twilio-1.2.0 lib/mock/twilio/middleware/proxy.rb
mock-twilio-1.1.0 lib/mock/twilio/middleware/proxy.rb
mock-twilio-1.0.0 lib/mock/twilio/middleware/proxy.rb
mock-twilio-0.8.0 lib/mock/twilio/middleware/proxy.rb
mock-twilio-0.7.2 lib/mock/twilio/middleware/proxy.rb
mock-twilio-0.7.1 lib/mock/twilio/middleware/proxy.rb
mock-twilio-0.7.0 lib/mock/twilio/middleware/proxy.rb
mock-twilio-0.6.0 lib/mock/twilio/middleware/proxy.rb
mock-twilio-0.5.0 lib/mock/twilio/middleware/proxy.rb
mock-twilio-0.4.0 lib/mock/twilio/middleware/proxy.rb
mock-twilio-0.3.0 lib/mock/twilio/middleware/proxy.rb
mock-twilio-0.2.0 lib/mock/twilio/middleware/proxy.rb
mock-twilio-0.1.0 lib/mock/twilio/middleware/proxy.rb