debug log

This commit is contained in:
Tordarus 2022-01-14 16:55:11 +01:00
parent 8d8f041946
commit 1128a10561

View File

@ -7,6 +7,7 @@ import (
"fmt" "fmt"
"io" "io"
"io/fs" "io/fs"
"log"
"net/http" "net/http"
"net/url" "net/url"
"os" "os"
@ -44,6 +45,7 @@ func main() {
} }
func handler(w http.ResponseWriter, r *http.Request) { func handler(w http.ResponseWriter, r *http.Request) {
log.Println(r.Method, getPath(r.URL.Path, r))
switch r.Method { switch r.Method {
case "GET": case "GET":
get(w, r) get(w, r)
@ -86,8 +88,6 @@ func get(w http.ResponseWriter, r *http.Request) {
return return
} }
fmt.Println(path, files)
for _, file := range files { for _, file := range files {
fmt.Fprintln(w, url.QueryEscape(file.Name())) fmt.Fprintln(w, url.QueryEscape(file.Name()))
} }