test for order properly

This commit is contained in:
Your Name 2018-09-02 21:18:04 +00:00
parent e1abbb6f33
commit c28ea0e348
1 changed files with 1 additions and 1 deletions

View File

@ -71,7 +71,7 @@ func dirList(w http.ResponseWriter, r *http.Request, f http.File) {
} }
order := "" order := ""
o, ok := r.URL.Query()["key"] o, ok := r.URL.Query()["key"]
if !ok || (order != "asc" && order != "desc") { if !ok || (o[0] != "asc" && o[0] != "desc") {
order = "asc" order = "asc"
} else { } else {
order = o[0] order = o[0]