lib/carrierwave/downloader/base.rb
##
# Processes the given URL by parsing it, and escaping if necessary. Public to allow overriding.
#
# === Parameters
#
# [url (String)] The URL where the remote file is stored
#
Processes the given URL by parsing it, and escaping if necessary. Public to allow overriding.
Parameters

[url (String)] The URL where the remote file is stored
Processes the given URL by parsing it and escaping if necessary . Public to allow overriding . Parameters [ url ( String ) ] The URL where the remote file is stored
def process_uri(uri)
        uri_parts = uri.split('?')
        encoded_uri = Addressable::URI.parse(uri_parts.shift).normalize.to_s
        query = uri_parts.any? ? "?#{uri_parts.join('?')}" : ''
        begin
          URI.parse("#{encoded_uri}#{query}")
        rescue URI::InvalidURIError
          URI.parse("#{encoded_uri}#{URI::DEFAULT_PARSER.escape(query)}")
        end
      rescue URI::InvalidURIError, Addressable::URI::InvalidURIError
        raise CarrierWave::DownloadError, "couldn't parse URL: #{uri}"
      end
def process_uri ( uri ) uri_parts = uri . split ( '?' ) encoded_uri = Addressable :: URI . parse ( uri_parts . shift ) . normalize . to_s query = uri_parts . any? ? "?#{uri_parts.join('?')}" : '' begin URI . parse ( "#{encoded_uri}#{query}" ) rescue URI :: InvalidURIError URI . parse ( "#{encoded_uri}#{URI::DEFAULT_PARSER.escape(query)}" ) end rescue URI :: InvalidURIError , Addressable :: URI :: InvalidURIError raise CarrierWave :: DownloadError , "couldn't parse URL: #{uri}" end
Processes the given URL by parsing it, and escaping if necessary.
Processes the given URL by parsing it and escaping if necessary .
uri