summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authoreltrac <hi@eltr.ac>2026-10-10 10:14:17 +0800
committereltrac <hi@eltr.ac>2026-10-10 10:14:46 +0800
commit7ab402f5f3d12e3c1a8252515b1a79c4824c6300 (patch)
treee0152e49b2890ca56ea010b254d44979a725ca60 /src
parent785b3a80e946b3a595a9d140ba277a448d9f38cf (diff)
receiver: should not call normalize if source/target is nil
if source or target is nil, it would not return an error message but will throw an uncaught exception java.lang.NullPointerException: Cannot invoke "String.length()" because "this.input" is null this is fixed by nil-guarding normalize function call
Diffstat (limited to 'src')
-rw-r--r--src/weepinbell/webserver/receiver.clj6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/weepinbell/webserver/receiver.clj b/src/weepinbell/webserver/receiver.clj
index 9d14a10..1a34f8c 100644
--- a/src/weepinbell/webserver/receiver.clj
+++ b/src/weepinbell/webserver/receiver.clj
@@ -36,8 +36,10 @@
Return JSON response of pending notification, rejection or error."
[wm wmc config]
(let [{:keys [s t]} wm
- source (normalize s)
- target (normalize t)
+ ;; if params are nil, use empty string
+ ;; empty strings will fail check-request
+ source (if s (normalize s) "")
+ target (if t (normalize t) "")
new-wm {:s source :t target}
allowlist (:allowed-target-domains config)]
;; Request verification