Skip to content

Commit

Permalink
Minor filserver improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
razzie committed Nov 12, 2020
1 parent a82bb6a commit 35c6b4f
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion fileserver.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,10 @@ tr:not(:first-child):hover > td {
<td>{{.Modified}}</td>
<td>{{.Created}}</td>
</tr>
{{else}}
<tr>
<td colspan="4">Empty</td>
</tr>
{{end}}
</table>
`))
Expand Down Expand Up @@ -103,7 +107,7 @@ func (fs *fileServer) handleDir(w http.ResponseWriter, dir http.File, uri string
return files[i].IsDir() && !files[j].IsDir()
})
entries := make([]fsEntry, 0, len(files)+1)
if uri != "." {
if uri != "." && uri != "/" {
entries = append(entries, fsEntry{
Name: "..",
FullName: path.Join(fs.prefix, path.Dir(uri)),
Expand Down

0 comments on commit 35c6b4f

Please sign in to comment.