Method: Msf::Exploit::Remote::HttpClient#normalize_uri

Defined in:
lib/msf/core/exploit/remote/http_client.rb

#normalize_uri(*strs) ⇒ Object

Returns a modified version of the URI that:

  1. Always has a starting slash

  2. Removes all the double slashes



562
563
564
565
566
567
568
569
570
571
572
573
# File 'lib/msf/core/exploit/remote/http_client.rb', line 562

def normalize_uri(*strs)
  new_str = strs * "/"

  new_str = new_str.gsub!("//", "/") while new_str.index("//")

  # Makes sure there's a starting slash
  unless new_str[0,1] == '/'
    new_str = '/' + new_str
  end

  new_str
end