File tree Expand file tree Collapse file tree 3 files changed +9
-8
lines changed Expand file tree Collapse file tree 3 files changed +9
-8
lines changed Original file line number Diff line number Diff line change 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)))
Original file line number Diff line number Diff line change 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])
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="
Original file line number Diff line number Diff line change 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}})))
You can’t perform that action at this time.
0 commit comments