module Rack::Utils

def clean_path_info(path_info)

def clean_path_info(path_info)
  parts = path_info.split PATH_SEPS
  clean = []
  parts.each do |part|
    next if part.empty? || part == '.'
    part == '..' ? clean.pop : clean << part
  end
  clean_path = clean.join(::File::SEPARATOR)
  clean_path.prepend("/") if parts.empty? || parts.first.empty?
  clean_path
end