summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authoreltrac <hi@eltr.ac>2026-10-16 10:36:54 +0800
committereltrac <hi@eltr.ac>2026-10-16 10:36:54 +0800
commit214d521e59d636c30249ab724542d5f80077835f (patch)
treea62f67731fdeecec5f489265c1f68abb79545c25 /src
parent1799245e28d247d6b1ec3c9cb4bc97906649ed2a (diff)
test: improve coverage #28
- storage-test: worker should handle other storage operations if some of them throws Exception - storage-test: microformats and proxied-photo should be stored as is - microformats-test: use-prop shuold handle both string and keyword typed keys - comment unused http client functions
Diffstat (limited to 'src')
-rw-r--r--src/weepinbell/http/client.clj37
1 files changed, 17 insertions, 20 deletions
diff --git a/src/weepinbell/http/client.clj b/src/weepinbell/http/client.clj
index f051d15..f854401 100644
--- a/src/weepinbell/http/client.clj
+++ b/src/weepinbell/http/client.clj
@@ -12,19 +12,15 @@
{:user-agent "WebmentionBot"
:timeout (* 20 1000)})
-(defn- wrap-response [response]
- (assoc response :content-length (or (get-in response [:headers "Content-Length"])
- (get-in response [:headers "content-length"]))))
-
(defn- wrap-promise [promised-response]
- (future (wrap-response @promised-response)))
+ (future @promised-response))
(defn post
"Sends POST request asynchronously. Returns a promise/future."
- ([url]
- (post url nil))
- ([url options]
- (post url options nil))
+ ;;([url]
+ ;; (post url nil))
+ ;;([url options]
+ ;; (post url options nil))
([url options callbacks]
(-> url
(hk/post (merge default-options options) callbacks)
@@ -32,8 +28,8 @@
(defn get
"Sends GET request asynchronously. Returns a promise/future."
- ([url]
- (get url nil))
+ ;;([url]
+ ;; (get url nil))
([url options]
(get url options nil))
([url options callbacks]
@@ -47,7 +43,7 @@
@(get url nil))
([url options]
@(get url options nil))
- ([url options callbacks]
+ #_([url options callbacks]
@(get url options callbacks)))
(defn head
@@ -61,14 +57,15 @@
(hk/head (merge default-options options) callbacks)
wrap-promise)))
-(defn head!
- "Sends HEAD request synchronously. Returns a response."
- ([url]
- @(head url nil))
- ([url options]
- @(head url options nil))
- ([url options callbacks]
- @(head url options callbacks)))
+;; Nothing referrences this function, commented for now
+;;(defn head!
+;; "Sends HEAD request synchronously. Returns a response."
+;; ([url]
+;; @(head url nil))
+;; ([url options]
+;; @(head url options nil))
+;; ([url options callbacks]
+;; @(head url options callbacks)))
(defn retryable? [error]
(let [retryables #{TimeoutException}]