File tree Expand file tree Collapse file tree 2 files changed +9
-7
lines changed Expand file tree Collapse file tree 2 files changed +9
-7
lines changed Original file line number Diff line number Diff line change 1212(defn- encode-params
1313 " Turn a map of parameters into a urlencoded string."
1414 [params]
15- (if params
15+ (when params
1616 (codec/form-encode params)))
1717
1818(defn header
5050 " Create a query string from a URI and a map of parameters."
5151 [request params]
5252 (let [query (:query-string request)]
53- (if (or query params)
53+ (when (or query params)
5454 (string/join " &"
5555 (remove string/blank?
5656 [query (encode-params params)])))))
7474 " Set the body of the request. The supplied body value can be a string or
7575 a map of parameters to be url-encoded."
7676 {:arglists '([request body-value])}
77- (fn [request x] (type x)))
77+ (fn [_request x] (type x)))
7878
7979(defmethod body String [request ^String string]
8080 (body request (.getBytes string)))
8989 (content-type " application/x-www-form-urlencoded" )
9090 (body (encode-params params))))
9191
92- (defmethod body nil [request params ]
92+ (defmethod body nil [request _params ]
9393 request )
9494
9595(defn json-body
Original file line number Diff line number Diff line change 11(ns ring.mock.request-test
2- (:require [clojure.java.io :as io])
3- (:use clojure.test
4- ring.mock.request))
2+ (:require [clojure.java.io :as io]
3+ [clojure.test :refer [deftest is testing]]
4+ [ring.mock.request :refer [body content-length content-type cookie
5+ header json-body multipart-body
6+ query-string request]]))
57
68(deftest test-request
79 (testing " relative uri"
You can’t perform that action at this time.
0 commit comments