Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

carrierwave fails to load certain url #764

Closed
jhjwind opened this issue Jun 20, 2012 · 2 comments
Closed

carrierwave fails to load certain url #764

jhjwind opened this issue Jun 20, 2012 · 2 comments

Comments

@jhjwind
Copy link

jhjwind commented Jun 20, 2012

@bensie
Copy link
Member

bensie commented Jun 20, 2012

You need to override this method to meet your needs for handling special characters in the URL:
https://github.com/jnicklas/carrierwave/blob/master/lib/carrierwave/uploader/download.rb#L72

@bensie bensie closed this as completed Jun 20, 2012
@jhjwind
Copy link
Author

jhjwind commented Jun 20, 2012

In case someone has the same problem, put these codes in the carrierwave initializer.rb

CarrierWave::Uploader::Download.module_eval do
  def process_uri(uri)
    begin
      URI.parse(uri)
    rescue
      URI.parse(URI.escape(URI.unescape(uri)))
    end
  end

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants