diff options
| author | eltrac <hi@eltr.ac> | 2026-03-17 10:42:48 +0800 |
|---|---|---|
| committer | eltrac <hi@eltr.ac> | 2026-03-17 10:42:48 +0800 |
| commit | a0bc9187ebfb20d34174d32dec497a7e5b279c63 (patch) | |
| tree | b142a114695edc700f5fa7bfb3596d643f3ee055 /src | |
| parent | ce13717aa287c1e2347b168e3fdcf8a3084ca472 (diff) | |
feat: respond with JSON when webmention query is not found
Diffstat (limited to 'src')
| -rw-r--r-- | src/weepinbell/retriever.clj | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/weepinbell/retriever.clj b/src/weepinbell/retriever.clj index ee9239e..69d9d69 100644 --- a/src/weepinbell/retriever.clj +++ b/src/weepinbell/retriever.clj @@ -18,18 +18,20 @@ :else identity)] ;; Use identity instead of not-empty for "no filter" (respond-json (filter pred data)))) -(defn respond-json-or-404 [data] +(defn respond-webmention-json [data] (if data (respond-json data) - (respond-json {:message "webmention not found"} 404))) + (respond-json {:status 404 + :message "Webmention does not exist or is pending for verification."} + 404))) (defn retrieve-by-id "Get one specific webmention by ID." [id] - (respond-json-or-404 (storage/get-wm id))) + (respond-webmention-json (storage/get-wm id))) (defn retrieve-by-url "Get one specific webmention by source and target." [source target] - (respond-json-or-404 (storage/get-wm source target))) + (respond-webmention-json (storage/get-wm source target))) |
