method
normalize_path
![No documentation Importance_0](https://d2vfyqvduarcvs.cloudfront.net/images/importance_0.png?1349367920)
normalize_path(path)
private
Hide source
# File lib/webrick/httputils.rb, line 21 def normalize_path(path) raise "abnormal path `#{path}'" if path[0] != // ret = path.dup ret.gsub!(%{/+}, '/') # // => / while ret.sub!(%/\.(?:/|\Z)', '/'); end # /. => / while ret.sub!(%/(?!\.\./)[^/]+/\.\.(?:/|\Z)', '/'); end # /foo/.. => /foo raise "abnormal path `#{path}'" if %{/\.\.(/|\Z)} =~ ret ret end