84 lines
4.7 KiB
HTML
84 lines
4.7 KiB
HTML
<html>
|
|
<head>
|
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
|
<link rel="stylesheet" href="../../coverage.css"/> <title> clj_activitypub/internal/http_util.clj </title>
|
|
</head>
|
|
<body>
|
|
<span class="covered" title="1 out of 1 forms covered">
|
|
001 (ns clj-activitypub.internal.http-util
|
|
</span><br/>
|
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
|
002 (:require [clj-activitypub.internal.crypto :as crypto])
|
|
</span><br/>
|
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
|
003 (:import (java.net URLEncoder)
|
|
</span><br/>
|
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
|
004 (java.time OffsetDateTime ZoneOffset)
|
|
</span><br/>
|
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
|
005 (java.time.format DateTimeFormatter)))
|
|
</span><br/>
|
|
<span class="blank" title="0 out of 0 forms covered">
|
|
006
|
|
</span><br/>
|
|
<span class="covered" title="1 out of 1 forms covered">
|
|
007 (defn encode-url-params [params]
|
|
</span><br/>
|
|
<span class="covered" title="2 out of 2 forms covered">
|
|
008 (->> params
|
|
</span><br/>
|
|
<span class="covered" title="2 out of 2 forms covered">
|
|
009 (reduce-kv
|
|
</span><br/>
|
|
<span class="covered" title="1 out of 1 forms covered">
|
|
010 (fn [coll k v]
|
|
</span><br/>
|
|
<span class="covered" title="3 out of 3 forms covered">
|
|
011 (conj coll
|
|
</span><br/>
|
|
<span class="covered" title="11 out of 11 forms covered">
|
|
012 (str (URLEncoder/encode (name k)) "=" (URLEncoder/encode (str v)))))
|
|
</span><br/>
|
|
<span class="covered" title="1 out of 1 forms covered">
|
|
013 [])
|
|
</span><br/>
|
|
<span class="covered" title="3 out of 3 forms covered">
|
|
014 (interpose "&")
|
|
</span><br/>
|
|
<span class="covered" title="2 out of 2 forms covered">
|
|
015 (apply str)))
|
|
</span><br/>
|
|
<span class="blank" title="0 out of 0 forms covered">
|
|
016
|
|
</span><br/>
|
|
<span class="covered" title="1 out of 1 forms covered">
|
|
017 (defn date []
|
|
</span><br/>
|
|
<span class="not-covered" title="0 out of 3 forms covered">
|
|
018 (-> (OffsetDateTime/now (ZoneOffset/UTC))
|
|
</span><br/>
|
|
<span class="not-covered" title="0 out of 1 forms covered">
|
|
019 (.format DateTimeFormatter/RFC_1123_DATE_TIME)))
|
|
</span><br/>
|
|
<span class="blank" title="0 out of 0 forms covered">
|
|
020
|
|
</span><br/>
|
|
<span class="covered" title="1 out of 1 forms covered">
|
|
021 (defn digest
|
|
</span><br/>
|
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
|
022 "Accepts body from HTTP request and generates string
|
|
</span><br/>
|
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
|
023 for use in HTTP `Digest` request header."
|
|
</span><br/>
|
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
|
024 [body]
|
|
</span><br/>
|
|
<span class="not-covered" title="0 out of 6 forms covered">
|
|
025 (str "sha-256=" (crypto/sha256-base64 body)))
|
|
</span><br/>
|
|
</body>
|
|
</html>
|