 the directory listing for a specific directory, use the file
 system path.
 
-If a static asset directory cannot be found, `PlugStaticLs`
+If a static asset directory specified is not found, `PlugStaticLs`
 simply forwards the connection to the rest of the pipeline.
-If the directory is found, `PlugStaticLs` returns the
-directory listing page in HTML.
+If the directory is found, `PlugStaticLs` verifies the path
+given in `conn.path_info` and the path must be a subset of `:at` path
+for showing the directory listing; otherwise `PlugStaticLs`
+forwards the connection to the rest of the pipeline.
 
 ## Options
 

    end
  end

  # XXX: should this code be like this? Isn't File module function sufficient?
  defp directory_file_info(path) do
    case :prim_file.read_file_info(path) do
      {:ok, file_info(type: :directory) = file_info} ->

  defp path(from, segments),
    do: Path.join([from|segments])

  # if not a subset, returns nil instead of []
  defp subset([h|expected], [h|actual]),
    do: subset(expected, actual)
  defp subset([], actual),
    do: actual
  defp subset(_, _),
    do: nil

  defp invalid_path?([h|_]) when h in [".", "..", ""], do: true
  defp invalid_path?([h|t]), do: String.contains?(h, ["/", "\\", ":"]) or invalid_path?(t)
