From 960daa2b9f5d8bb4f2b267d8c4247a44699b5700 Mon Sep 17 00:00:00 2001 From: Zlatin Balevsky Date: Tue, 28 May 2019 22:38:43 +0100 Subject: [PATCH] close endpoint on 404 and bad requests --- .../src/main/groovy/com/muwire/core/upload/UploadManager.groovy | 2 ++ 1 file changed, 2 insertions(+) diff --git a/core/src/main/groovy/com/muwire/core/upload/UploadManager.groovy b/core/src/main/groovy/com/muwire/core/upload/UploadManager.groovy index 533e9447..e74d6798 100644 --- a/core/src/main/groovy/com/muwire/core/upload/UploadManager.groovy +++ b/core/src/main/groovy/com/muwire/core/upload/UploadManager.groovy @@ -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 }