Skip to content

Commit 6c402f9

Browse files
committed
WIP on supporting client/*
1 parent 04a71cd commit 6c402f9

File tree

3 files changed

+22
-8
lines changed

3 files changed

+22
-8
lines changed

test/aleph/http/clj_http/client_test.clj

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
:server-name "localhost"
2727
:server-port 18080})
2828

29-
(def request (make-request #'client/request {:using-middleware? true}))
29+
(def request (make-request client/request {:using-middleware? true}))
3030

3131
(defn parse-form-params [s]
3232
(->> (str/split (form-decode-str s) #"&")

test/aleph/http/clj_http/core_test.clj

+7-1
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,13 @@
156156
:server-name "localhost"
157157
:server-port 18080})
158158

159-
(def request (make-request #'core/request {:using-middleware? false}))
159+
160+
(def request (make-request core/request {:using-middleware? false}))
161+
162+
(use-fixtures :once
163+
(fn [f]
164+
(binding [client/request (make-request client/request {:using-middleware? true})]
165+
(f))))
160166

161167
(defn slurp-body [req]
162168
(slurp (:body req)))

test/aleph/http/clj_http/util.clj

+14-6
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,10 @@
2828
(defn header-keys
2929
"Returns a set of headers of interest"
3030
[m]
31-
(-> (apply dissoc m ignored-headers)
32-
(keys)
33-
(set)))
31+
(->> (apply dissoc m ignored-headers)
32+
(keys)
33+
(map str/lower-case)
34+
(set)))
3435

3536
(defn is-headers=
3637
"Are the two header maps equal?
@@ -71,9 +72,15 @@
7172
(.close clj-http-body)
7273
(proxy-super close))))))
7374

74-
(do
75-
(is (bs/bytes= clj-http-body aleph-body))
76-
clj-http-body))
75+
(try
76+
(do
77+
(is (bs/bytes= clj-http-body aleph-body))
78+
clj-http-body)
79+
(catch Exception e
80+
(println "clj-http body class: " (class clj-http-body))
81+
(prn clj-http-body)
82+
(flush)
83+
(throw e))))
7784
(do
7885
(is (= clj-http-body aleph-body))
7986
clj-http-body)))
@@ -170,6 +177,7 @@
170177
aleph-resp @(http/request aleph-ring-map)]
171178
(is (= (:status clj-http-resp) (:status aleph-resp)))
172179

180+
(prn aleph-resp)
173181

174182
#_(when (not= (:status clj-http-resp) (:status aleph-resp))
175183
(println "clj-http req:")

0 commit comments

Comments
 (0)