jnicklas/carrierwave — pull request #1006 by taavo (2013-03-02 01:33:09+00:00)
Title: Don't double-encode fog authenticated_urls

This is a re-do of #996, following @twalpole's bad news that although fog public_urls aren't encoded, fog authenticated_urls are.

I'm moving the logic upstream: Instead of encoding the output of the old Uploader#url function, I'm improving Uploader#url to encode _only_ urls we're generating from the path. Then I'm improving Fog#public_url to encode urls that aren't coming out of Fog itself (since presumably those are already encoded).

Also—and this is the change I'm worried about—since Fog#filename is dependent on Fog#url, I'm _decoding_ the filename there. This seemed least wrong, since Fog#filename is apparently trying to deduce the original filename based only on the current url. For people with `fog_public = true` this shouldn't change anything, since previously we weren't encoding at all. For people with `fog_public = false`, Fog#filename used to be encoded, and no longer is. I don't _think_ this is going to break existing apps, but I don't _know_, and after trying to dig through the code myself, I think I may need the help of a brave tester and/or somebody wiser about carrierwave internals.

Feedback is welcome. Thanks.