Skip to content

Commit 0920783

Browse files
committed
Satisfy clj-kondo and Eastwood
1 parent f0b7aeb commit 0920783

File tree

3 files changed

+9
-8
lines changed

3 files changed

+9
-8
lines changed

src/clj_http/lite/client.clj

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
(ns clj-http.lite.client
22
"Batteries-included HTTP client."
3-
(:use [slingshot.slingshot :only [throw+]])
43
(:require [clojure.string :as str]
54
[clojure.java.io :as io]
65
[clj-http.lite.core :as core]
76
[clj-http.lite.links :refer [wrap-links]]
8-
[clj-http.lite.util :as util])
7+
[clj-http.lite.util :as util]
8+
[slingshot.slingshot :refer [throw+]])
99
(:import (java.io InputStream File)
1010
(java.net URL UnknownHostException))
1111
(:refer-clojure :exclude (get update)))

src/clj_http/lite/core.clj

+5-4
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,9 @@
4747
(proxy [HostnameVerifier] []
4848
(verify [^String hostname ^SSLSession session] true)))
4949

50-
(defn trust-invalid-manager []
50+
(defn trust-invalid-manager
5151
"This allows the ssl socket to connect with invalid/self-signed SSL certs."
52+
[]
5253
(reify X509TrustManager
5354
(getAcceptedIssuers [this] nil)
5455
(checkClientTrusted [this certs authType])
@@ -69,13 +70,13 @@
6970
uri
7071
(when query-string (str "?" query-string)))
7172
_ (when insecure?
72-
(do (HttpsURLConnection/setDefaultSSLSocketFactory
73+
(HttpsURLConnection/setDefaultSSLSocketFactory
7374
(.getSocketFactory
7475
(doto (SSLContext/getInstance "SSL")
7576
(.init nil (into-array TrustManager [(trust-invalid-manager)])
7677
(new SecureRandom)))))
77-
(HttpsURLConnection/setDefaultHostnameVerifier (my-host-verifier))))
78-
^HttpURLConnection conn (.openConnection ^URL (URL. http-url))]
78+
(HttpsURLConnection/setDefaultHostnameVerifier (my-host-verifier)))
79+
^HttpURLConnection conn (.openConnection (URL. http-url))]
7980
(when (and content-type character-encoding)
8081
(.setRequestProperty conn "Content-Type" (str content-type
8182
"; charset="

test/clj_http/test/links_test.clj

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
(ns clj-http.test.links-test
22
"Imported from https://github.com/dakrone/clj-http/blob/217393258e7863514debece4eb7b23a7a3fa8bd9/test/clj_http/test/links_test.clj"
3-
(:require [clj-http.lite.links :refer :all]
4-
[clojure.test :refer :all]))
3+
(:require [clj-http.lite.links :refer [wrap-links]]
4+
[clojure.test :refer [deftest is testing]]))
55

66
(defn- link-handler [link-header]
77
(wrap-links (constantly {:headers {"link" link-header}})))

0 commit comments

Comments
 (0)