File tree Expand file tree Collapse file tree 2 files changed +10
-3
lines changed Expand file tree Collapse file tree 2 files changed +10
-3
lines changed Original file line number Diff line number Diff line change 391391 (getMethod [] (.toUpperCase (name method) Locale/ROOT)))
392392 (.setURI (URI. url)))))
393393
394+ (def proxy-head-with-body (make-proxy-method-with-body :head ))
394395(def proxy-delete-with-body (make-proxy-method-with-body :delete ))
395396(def proxy-get-with-body (make-proxy-method-with-body :get ))
396397(def proxy-copy-with-body (make-proxy-method-with-body :copy ))
413414 :get (if body
414415 (proxy-get-with-body http-url)
415416 (HttpGet. http-url))
416- :head (HttpHead. http-url)
417+ :head (if body
418+ (proxy-head-with-body http-url)
419+ (HttpHead. http-url))
417420 :put (HttpPut. http-url)
418421 :post (HttpPost. http-url)
419422 :options (HttpOptions. http-url)
Original file line number Diff line number Diff line change 104104 {:status 200 :body " delete-with-body" }
105105 [:post " /multipart" ]
106106 {:status 200 :body (:body req)}
107+ [:head " /head-with-body" ]
108+ {:status 200 :headers {" body" (slurp (:body req))}}
107109 [:get " /get-with-body" ]
108110 {:status 200 :body (:body req)}
109111 [:options " /options" ]
412414
413415(deftest ^:integration head-with-body
414416 (run-server )
415- (let [resp (request {:request-method :head :uri " /head" :body " foo" })]
416- (is (= 200 (:status resp)))))
417+ (let [resp (request {:request-method :head :uri " /head-with-body"
418+ :body (.getBytes " foo" )})]
419+ (is (= 200 (:status resp)))
420+ (is (= " foo" (get-in resp [:headers " body" ])))))
417421
418422(deftest ^:integration t-clojure-output-coercion
419423 (run-server )
You can’t perform that action at this time.
0 commit comments