From 7ee45e86ac3d2838c5224e8132e0d7219f9bfdc5 Mon Sep 17 00:00:00 2001 From: BillyZ1435 Date: Wed, 26 Oct 2022 20:39:31 -0400 Subject: [PATCH] put-requests: request can have extra parameters --- src/main/java/ca/utoronto/utm/mcs/ReqHandler.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main/java/ca/utoronto/utm/mcs/ReqHandler.java b/src/main/java/ca/utoronto/utm/mcs/ReqHandler.java index 4a77611..d7971b5 100644 --- a/src/main/java/ca/utoronto/utm/mcs/ReqHandler.java +++ b/src/main/java/ca/utoronto/utm/mcs/ReqHandler.java @@ -68,7 +68,7 @@ public void addActor(HttpExchange r) throws IOException, JSONException { String name, actorId; - if (deserialized.length() == 2 && deserialized.has("name") && deserialized.has("actorId")) { + if (deserialized.has("name") && deserialized.has("actorId")) { name = deserialized.getString("name"); actorId = deserialized.getString("actorId"); } else { @@ -100,7 +100,7 @@ public void addMovie(HttpExchange r) throws IOException, JSONException { String name, movieId; - if (deserialized.length() == 2 && deserialized.has("name") && deserialized.has("movieId")) { + if (deserialized.has("name") && deserialized.has("movieId")) { name = deserialized.getString("name"); movieId = deserialized.getString("movieId"); } else { @@ -132,7 +132,7 @@ public void addRelationship(HttpExchange r) throws IOException, JSONException { String actorId, movieId; - if (deserialized.length() == 2 && deserialized.has("actorId") && deserialized.has("movieId")) { + if (deserialized.has("actorId") && deserialized.has("movieId")) { actorId = deserialized.getString("actorId"); movieId = deserialized.getString("movieId"); } else {