File tree Expand file tree Collapse file tree 1 file changed +2
-12
lines changed Expand file tree Collapse file tree 1 file changed +2
-12
lines changed Original file line number Diff line number Diff line change 107
107
{:status 200 :body " delete-with-body" }
108
108
[:post " /multipart" ]
109
109
{:status 200 :body (:body req)}
110
- [:head " /head-with-body" ]
111
- {:status 200 :headers {" body" (slurp (:body req))}}
112
110
[:get " /get-with-body" ]
113
111
{:status 200 :body (:body req)}
114
112
[:options " /options" ]
150
148
(defonce ^org.eclipse.jetty.server.Server server
151
149
(ring/run-jetty (add-headers-if-requested #'handler) {:port 18080 :join? false })))
152
150
153
- (defn restart-server
154
- []
155
- (.stop server)
156
- (.start server))
157
-
158
151
(defn localhost [path]
159
152
(str " http://localhost:18080" path))
160
153
166
159
(defn slurp-body [req]
167
160
(slurp (:body req)))
168
161
169
-
170
162
(deftest ^:integration makes-get-request
171
163
(run-server )
172
164
(let [resp (request {:request-method :get :uri " /get" })]
422
414
423
415
(deftest ^:integration head-with-body
424
416
(run-server )
425
- (let [resp (request {:request-method :head :uri " /head-with-body"
426
- :body (.getBytes " foo" )})]
427
- (is (= 200 (:status resp)))
428
- (is (= " foo" (get-in resp [:headers " body" ])))))
417
+ (let [resp (request {:request-method :head :uri " /head" :body " foo" })]
418
+ (is (= 200 (:status resp)))))
429
419
430
420
(deftest ^:integration t-clojure-output-coercion
431
421
(run-server )
You can’t perform that action at this time.
0 commit comments