Module: Better_URI_RFC3986_Parser

Defined in:
lib/epitools/core_ext/misc.rb

Overview

Stupid workaround for URI blowing up when it receives a [ or ] character

Constant Summary collapse

ESCAPE_ME_PLZ =
"[]{}!"

Instance Method Summary collapse

Instance Method Details

#split(uri) ⇒ Object


188
189
190
191
192
193
194
195
196
197
# File 'lib/epitools/core_ext/misc.rb', line 188

def split(uri)
  subsitutions = ESCAPE_ME_PLZ.chars.map { |c| [c, CGI.escape(c)] }
  subsitutions << [" ", "%20"]

  subsitutions.each do |find, replace|
    uri = uri.gsub(find, replace)
  end

  super(uri)
end