diff options
| author | eltrac <hi@eltr.ac> | 2026-09-18 14:11:25 +0800 |
|---|---|---|
| committer | eltrac <hi@eltr.ac> | 2026-09-18 14:12:20 +0800 |
| commit | 41ad0b78bcac340d3b8640be30b9e6f2dcf9bf2b (patch) | |
| tree | 18f0daf6532c64c521cfa1344791fea81e613ceb | |
| parent | a65eedd4ec10badf69a6c1e638019cadc5e04e82 (diff) | |
utils.url: valid-http-url? should return false for non-string types
| -rw-r--r-- | src/weepinbell/utils/url.clj | 1 |
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)))
|
