close endpoint on 404 and bad requests

pull/4/head
Zlatin Balevsky 2019-05-28 22:38:43 +01:00
parent 46420740da
commit 960daa2b9f
1 changed files with 2 additions and 0 deletions

View File

@ -35,6 +35,7 @@ public class UploadManager {
log.info "file not found"
e.getOutputStream().write("404 File Not Found".getBytes(StandardCharsets.US_ASCII))
e.getOutputStream().flush()
e.close()
return
}
@ -42,6 +43,7 @@ public class UploadManager {
dis.readFully(rn)
if (rn != "\r\n".getBytes(StandardCharsets.US_ASCII)) {
log.warning("Malformed GET header")
e.close()
return
}