Clamav prescan (#389)

This commit is contained in:
Andrea Spacca
2022-01-09 22:14:10 +01:00
committed by GitHub
parent 492731e31f
commit cff0a88bf3
7 changed files with 184 additions and 129 deletions

View File

@ -45,14 +45,14 @@ func (s *Server) virusTotalHandler(w http.ResponseWriter, r *http.Request) {
vt, err := virustotal.NewVirusTotal(s.VirusTotalKey)
if err != nil {
http.Error(w, err.Error(), 500)
http.Error(w, err.Error(), http.StatusInternalServerError)
}
reader := r.Body
result, err := vt.Scan(filename, reader)
if err != nil {
http.Error(w, err.Error(), 500)
http.Error(w, err.Error(), http.StatusInternalServerError)
}
s.logger.Println(result)