We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 0712435 commit ac3d006Copy full SHA for ac3d006
lib/carrierwave/uploader/download.rb
@@ -92,8 +92,8 @@ def process_uri(uri)
92
rescue URI::InvalidURIError
93
uri_parts = uri.split('?')
94
# regexp from Ruby's URI::Parser#regexp[:UNSAFE], with [] specifically removed
95
- encoded_uri = URI::DEFAULT_PARSER.unescape(uri_parts.shift, /[^\-_.!~*'()a-zA-Z\d;\/?:@&=+$,]/)
96
- encoded_uri << '?' << URI::DEFAULT_PARSER.unescape(uri_parts.join('?')) if uri_parts.any?
+ encoded_uri = URI::DEFAULT_PARSER.escape(uri_parts.shift, /[^\-_.!~*'()a-zA-Z\d;\/?:@&=+$,]/)
+ encoded_uri << '?' << URI::DEFAULT_PARSER.escape(uri_parts.join('?')) if uri_parts.any?
97
URI.parse(encoded_uri) rescue raise CarrierWave::DownloadError, "couldn't parse URL"
98
end
99
0 commit comments