jnicklas/carrierwave — pull request #622 by ngauthier (2012-02-14 20:07:19+00:00)
Title: Leave URI Sanitization to the user

Square bracket uris cannot be used to upload an image via carrierwave. This is because of a bug in ruby whose fix has been rejected.

I believe that a reasonable approach is to delegate the duty of sanitizing URIs to the user (i.e. developer using the library). That way they can use whatever practice they are comfortable with to sanitize URIs.

In my case that caused this patch, I have a list of URIs from a trusted source and I am doing a bulk import. Carrierwave is incredibly good at this, except for URIs with brackets in them.

This patch passes all tests because it changes the expectations of the library, as seen in the diff.

If an invalid URI is passed to carrierwave, URI will raise a URI::InvalidURIError, which is tested for in the specs. This will easily alert the developer to the cause of the problem.

Thanks!
xoxo @ngauthier