Improvements

This commit is contained in:
wim.de.jager 2021-06-14 14:24:16 +02:00
parent 07a0607fd9
commit a001a4104e

View file

@ -119,7 +119,7 @@ func scanHandler(w http.ResponseWriter, r *http.Request) {
return return
} }
for s := range response { s := <-response
w.Header().Set("Content-Type", "application/json; charset=utf-8") w.Header().Set("Content-Type", "application/json; charset=utf-8")
respJson, err := json.Marshal(&s) respJson, err := json.Marshal(&s)
@ -143,7 +143,6 @@ func scanHandler(w http.ResponseWriter, r *http.Request) {
fmt.Fprint(w, string(respJson)) fmt.Fprint(w, string(respJson))
fmt.Printf(time.Now().Format(time.RFC3339)+" Scan result for: %v, %v\n", part.FileName(), s) fmt.Printf(time.Now().Format(time.RFC3339)+" Scan result for: %v, %v\n", part.FileName(), s)
}
fmt.Printf(time.Now().Format(time.RFC3339) + " Finished scanning: " + part.FileName() + "\n") fmt.Printf(time.Now().Format(time.RFC3339) + " Finished scanning: " + part.FileName() + "\n")
default: default:
w.WriteHeader(http.StatusMethodNotAllowed) w.WriteHeader(http.StatusMethodNotAllowed)