* expose query-string function from org.httpkit.client * add url-encode from httpkit client ns * cleanup and changelog
This commit is contained in:
parent
bd857ae3e1
commit
cf01d7f24d
3 changed files with 17 additions and 1 deletions
|
|
@ -7,6 +7,9 @@ A preview of the next release can be installed from
|
||||||
|
|
||||||
[Babashka](https://github.com/babashka/babashka): Native, fast starting Clojure interpreter for scripting
|
[Babashka](https://github.com/babashka/babashka): Native, fast starting Clojure interpreter for scripting
|
||||||
|
|
||||||
|
## Unreleased
|
||||||
|
- [#1438](https://github.com/babashka/babashka/issues/1438): expose `query-string` and `url-encode` functions from org.httpkit.client ([@bobisageek](https://github.com/bobisageek))
|
||||||
|
|
||||||
## 1.0.167 (2022-11-30)
|
## 1.0.167 (2022-11-30)
|
||||||
|
|
||||||
- [#1433](https://github.com/babashka/babashka/issues/1433): spec source as built-in fallback. When not including the
|
- [#1433](https://github.com/babashka/babashka/issues/1433): spec source as built-in fallback. When not including the
|
||||||
|
|
|
||||||
|
|
@ -72,7 +72,9 @@
|
||||||
'acl (copy-var acl cns)
|
'acl (copy-var acl cns)
|
||||||
'unlock (copy-var unlock cns)
|
'unlock (copy-var unlock cns)
|
||||||
'default-client (copy-var client/default-client cns)
|
'default-client (copy-var client/default-client cns)
|
||||||
'*default-client* default-client})
|
'*default-client* default-client
|
||||||
|
'query-string (copy-var client/query-string cns)
|
||||||
|
'url-encode (copy-var client/url-encode cns)})
|
||||||
|
|
||||||
(def sni-client-namespace
|
(def sni-client-namespace
|
||||||
{'ssl-configurer (copy-var sni-client/ssl-configurer sns)
|
{'ssl-configurer (copy-var sni-client/ssl-configurer sns)
|
||||||
|
|
|
||||||
|
|
@ -58,3 +58,14 @@
|
||||||
|
|
||||||
(deftest alter-var-root-test
|
(deftest alter-var-root-test
|
||||||
(is (alter-var-root (var client/*default-client*) (constantly sni/default-client))))
|
(is (alter-var-root (var client/*default-client*) (constantly sni/default-client))))
|
||||||
|
|
||||||
|
(deftest query-string-test
|
||||||
|
(is (= (client/query-string {:k1 "v1" :k2 "v2" :k3 nil :k4 ["v4a" "v4b"] :k5 []})
|
||||||
|
"k1=v1&k2=v2&k3=&k4=v4a&k4=v4b&k5="))
|
||||||
|
(is (= (client/query-string {:k1 \v :k2 'v2})
|
||||||
|
"k1=v&k2=v2")))
|
||||||
|
|
||||||
|
(deftest url-encode-test
|
||||||
|
(is (= "AbC" (client/url-encode "AbC")))
|
||||||
|
(is (= "%3C%3E%21%40%23%24%25%5E"
|
||||||
|
(client/url-encode "<>!@#$%^"))))
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue