     """
   end
 
-  defp gen_ls_entry(path, subpath) do
-    "<li><a href=\"" <> URI.encode(subpath <> path) <> "\">" <>
+  defp gen_ls_entry(path) do
+    "<li><a href=\"" <> URI.encode(path) <> "\">" <>
     Plug.HTML.html_escape(path) <> "</a></li>\n"
   end
 


      path = path(from, segments)
      directory_info = file_directory_info(conn, path)
      serve_directory_listing(directory_info, at, segments)
    else
      conn
    end

    :erlang.list_to_binary(
      Enum.map(pathlist,
               fn(x) ->
                 gen_ls_entry(:erlang.list_to_binary(x)) end))
    <>
    # postamble
    """
