method

clean_path_info

rails latest stable - Class: ActionDispatch::FileHandler

Method deprecated or moved

This method is deprecated or moved on the latest stable version. The last existing version (v4.1.8) is shown here.

clean_path_info(path_info)
private

No documentation available.

# File actionpack/lib/action_dispatch/middleware/static.rb, line 52
    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.unshift '/' if parts.empty? || parts.first.empty?

      ::File.join(*clean)
    end