From 68bcabe5c245a2d8e9219ab469c44445e190c928 Mon Sep 17 00:00:00 2001 From: ayunami2000 Date: Fri, 3 Jun 2022 13:27:37 -0400 Subject: [PATCH] fix httpd log spam (#223) fix httpd log spam with invalid url encoded strings (lol) Co-authored-by: Paldiu Co-authored-by: Ryan --- .../java/me/totalfreedom/totalfreedommod/httpd/NanoHTTPD.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/me/totalfreedom/totalfreedommod/httpd/NanoHTTPD.java b/src/main/java/me/totalfreedom/totalfreedommod/httpd/NanoHTTPD.java index c0566cc1..bd045b95 100644 --- a/src/main/java/me/totalfreedom/totalfreedommod/httpd/NanoHTTPD.java +++ b/src/main/java/me/totalfreedom/totalfreedommod/httpd/NanoHTTPD.java @@ -337,12 +337,12 @@ public abstract class NanoHTTPD */ protected String decodePercent(String str) { - String decoded = null; + String decoded = str; try { decoded = URLDecoder.decode(str, "UTF8"); } - catch (UnsupportedEncodingException ignored) + catch (UnsupportedEncodingException | IllegalArgumentException ignored) { } return decoded;