From e8954581f4fb7bed43e88fe2866d14d76dac9b4d Mon Sep 17 00:00:00 2001 From: lollyhunter Date: Thu, 9 May 2024 17:03:38 +0300 Subject: [PATCH] fix --- .../vk/itmo/test/smirnovdmitrii/server/DaoHttpServer.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/main/java/ru/vk/itmo/test/smirnovdmitrii/server/DaoHttpServer.java b/src/main/java/ru/vk/itmo/test/smirnovdmitrii/server/DaoHttpServer.java index d7b936b8c..b432cd080 100644 --- a/src/main/java/ru/vk/itmo/test/smirnovdmitrii/server/DaoHttpServer.java +++ b/src/main/java/ru/vk/itmo/test/smirnovdmitrii/server/DaoHttpServer.java @@ -169,10 +169,14 @@ private void handleRequestTask(final Request request, final HttpSession session) private void processRange(final Request request, final HttpSession session) throws IOException { final String startString = request.getParameter("start="); final String endString = request.getParameter("end="); - if (startString == null || startString.isBlank() || (endString != null && endString.isBlank())) { + if (startString == null || startString.isBlank()) { session.sendError(Response.BAD_REQUEST, "Missing range parameter \"start\"."); return; } + if (endString != null && endString.isBlank()) { + session.sendError(Response.BAD_REQUEST, "Missing range parameter \"end\"."); + return; + } final MemorySegment startKey = MemorySegment.ofArray(startString.getBytes(StandardCharsets.UTF_8)); final MemorySegment endKey; if (endString == null) {