Sha256: d5f9a8e2fc975ae0ee12026f7a491f9d5be03bea8760fd3fd1f4eddb9fce793e

Contents?: true

Size: 447 Bytes

Versions: 10

Compression:

Stored size: 447 Bytes

Contents

module Paperclip
  class HttpUrlProxyAdapter < UriAdapter
    def self.register
      Paperclip.io_adapters.register self do |target|
        String === target && target =~ REGEXP
      end
    end

    REGEXP = /\Ahttps?:\/\//.freeze

    def initialize(target, options = {})
      escaped = Paperclip::UrlGenerator.escape(target)
      super(URI(target == Paperclip::UrlGenerator.unescape(target) ? escaped : target), options)
    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
kt-paperclip-7.2.2 lib/paperclip/io_adapters/http_url_proxy_adapter.rb
kt-paperclip-7.2.1 lib/paperclip/io_adapters/http_url_proxy_adapter.rb
kt-paperclip-7.2.0 lib/paperclip/io_adapters/http_url_proxy_adapter.rb
kt-paperclip-6.4.2 lib/paperclip/io_adapters/http_url_proxy_adapter.rb
kt-paperclip-7.1.1 lib/paperclip/io_adapters/http_url_proxy_adapter.rb
kt-paperclip-7.1.0 lib/paperclip/io_adapters/http_url_proxy_adapter.rb
kt-paperclip-7.0.1 lib/paperclip/io_adapters/http_url_proxy_adapter.rb
kt-paperclip-7.0.0 lib/paperclip/io_adapters/http_url_proxy_adapter.rb
kt-paperclip-6.4.1 lib/paperclip/io_adapters/http_url_proxy_adapter.rb
kt-paperclip-6.4.0 lib/paperclip/io_adapters/http_url_proxy_adapter.rb