diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/weepinbell/feed.clj | 4 | ||||
| -rw-r--r-- | src/weepinbell/receiver.clj | 4 | ||||
| -rw-r--r-- | src/weepinbell/wrapper.clj | 8 |
3 files changed, 8 insertions, 8 deletions
diff --git a/src/weepinbell/feed.clj b/src/weepinbell/feed.clj index 638699d..f496152 100644 --- a/src/weepinbell/feed.clj +++ b/src/weepinbell/feed.clj @@ -3,7 +3,7 @@ [weepinbell.utils :refer [get-domain]] [weepinbell.config :refer [get-config]] [weepinbell.storage :as storage] - [digest :as digest]) + [md5.core :refer [string->md5-hex]]) (:import [java.time Instant])) (def feed-length (get-config :feed-length)) @@ -19,7 +19,7 @@ (->> wms (map #(let [wm (:webmention %) id (if-let [id (:id wm)] id - (digest/md5 (str (:source wm) (:target wm)))) + (string->md5-hex (str (:source wm) (:target wm)))) permalink (str (get-config :base-url) "/api/mention/" id) modified (:modified wm) pub-date (when modified diff --git a/src/weepinbell/receiver.clj b/src/weepinbell/receiver.clj index 662f53a..dbe3e2e 100644 --- a/src/weepinbell/receiver.clj +++ b/src/weepinbell/receiver.clj @@ -4,7 +4,7 @@ [clojure.core.async :refer [put!]] [weepinbell.utils :refer [validate-urls validate-target respond-json]] [weepinbell.config :refer [get-config]] - [digest :as digest] + [md5.core :refer [string->md5-hex]] [cheshire.core :as json])) (defn verify-request @@ -44,7 +44,7 @@ (put! wmc wm) ;; respond with 201 when Webmention passed checks and ;; was sent into queue, include a Location header - (let [wm-id (digest/md5 (str source target)) + (let [wm-id (string->md5-hex (str source target)) wm-url (str (get-config :base-url) "/api/mention/" wm-id) response {:status 201 :message "Webmention is accepted and pending for verification." diff --git a/src/weepinbell/wrapper.clj b/src/weepinbell/wrapper.clj index f1493c4..8c3246a 100644 --- a/src/weepinbell/wrapper.clj +++ b/src/weepinbell/wrapper.clj @@ -4,8 +4,8 @@ download-file]] [weepinbell.config :refer [get-config]] [weepinbell.microformats :as microformats] - [digest :as digest] - [taoensso.timbre :as timbre])) + [taoensso.timbre :as timbre] + [md5.core :refer [string->md5-hex]])) (defn- find-mf-photo [mf] (or (-> mf @@ -19,7 +19,7 @@ (if raw-photo (let [photo-url (str raw-photo) file-ext (or (re-find #"\.(?:jpg|jpeg|png|gif|webp)" photo-url) ".jpg") - filename (str (digest/md5 photo-url) file-ext) + filename (str (string->md5-hex photo-url) file-ext) local-path (str "data/avatars/" filename) public-path (str "/avatars/" filename)] ;; download photo if not exists @@ -38,7 +38,7 @@ javamap->map) wm {:source source :target target - :id (digest/md5 (str source target)) + :id (string->md5-hex (str source target)) :modified (System/currentTimeMillis)} proxied-photo (-> mf find-mf-photo proxy-mf-photo)] {:webmention wm |
