Module: Better_URI_RFC3986_Parser

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

Overview

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

Constant Summary collapse

ESCAPE_ME_PLZ =

::RFC3986_relative_ref

"[]{}!"

Instance Method Summary collapse

Instance Method Details

#split(uri) ⇒ Object



97
98
99
100
101
102
103
104
105
106
# File 'lib/epitools/core_ext/uri.rb', line 97

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