File tree Expand file tree Collapse file tree 2 files changed +9
-4
lines changed
Expand file tree Collapse file tree 2 files changed +9
-4
lines changed Original file line number Diff line number Diff line change 88 :milia-http-default-per-route " 10"
99 :milia-http-threads " 20" })
1010
11- (defproject onaio /milia " 0.3.27 -SNAPSHOT"
11+ (defproject onaio /milia " 0.3.28 -SNAPSHOT"
1212 :description " The ona.io Clojure Web API Client."
1313 :dependencies [; ; CORE MILIA REQUIREMENTS
1414 [cheshire " 5.6.3" ]
Original file line number Diff line number Diff line change 2121 (let [stateful-method? (in? [:post :put :patch ] method)
2222 param-key (if stateful-method? :form-params :query-params )
2323 ; ; With credentials always false
24- http-options (assoc http-options :with-credentials? false )]
25- ; ; If not JSON Params and not stateful and no-cache, add cache-buster
24+ http-options (assoc http-options :with-credentials? false )
25+ { :keys [username password]} *credentials*]
2626 (cond-> http-options
27+ ; ; If username and password are set use basic auth
28+ (assoc :basic-auth {:username username :password password})
29+ (and username password)
30+ ; ; If not JSON Params and not stateful and no-cache, add cache-buster
2731 (and no-cache?
2832 (not (:json-params http-options))
2933 (not stateful-method?))
4852 " Builds request headers for the HTTP request by adding
4953 Authorization, X-CSRFToken and Cache-control headers where necessary"
5054 [& {:keys [get-crsftoken? must-revalidate? accept-header auth-token]}]
51- (let [temp-token (:temp-token *credentials*)]
55+ (let [{:keys [token temp-token]} *credentials*
56+ auth-token (or auth-token token)]
5257 (into {} [(if auth-token
5358 [" Authorization" (str " Token " auth-token)]
5459 (when (and (not-empty temp-token) (is-not-null?
You can’t perform that action at this time.
0 commit comments