summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoreltrac <hi@eltr.ac>2026-09-18 14:11:25 +0800
committereltrac <hi@eltr.ac>2026-09-18 14:12:20 +0800
commit41ad0b78bcac340d3b8640be30b9e6f2dcf9bf2b (patch)
tree18f0daf6532c64c521cfa1344791fea81e613ceb
parenta65eedd4ec10badf69a6c1e638019cadc5e04e82 (diff)
utils.url: valid-http-url? should return false for non-string types
-rw-r--r--src/weepinbell/utils/url.clj1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/weepinbell/utils/url.clj b/src/weepinbell/utils/url.clj
index 5fe2b78..88c9fea 100644
--- a/src/weepinbell/utils/url.clj
+++ b/src/weepinbell/utils/url.clj
@@ -10,6 +10,7 @@
host (. IDN toASCII (-> url .getHost (string/replace "www." "")))]
(and (string/includes? host ".") ;; do not accept localhost and other non-TLD names
(or (= scheme "http") (= scheme "https"))))
+ (catch ClassCastException _ false) ;; not string
(catch MalformedURLException _ false)
(catch URISyntaxException _ false)))