Skip to content

Commit

Permalink
:as :json => :as :json-strict to upgrade clj-http 3.10.0
Browse files Browse the repository at this point in the history
  • Loading branch information
frenchy64 committed Feb 5, 2020
1 parent 9128b0f commit cd54860
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 11 deletions.
12 changes: 6 additions & 6 deletions dev/user.clj
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
search-url
{:basic-auth auth-str
:headers {"kbn-xsrf" ""}
:as :json
:as :json-strict
:content-type :json
:throw-exceptions false
:body (json/generate-string
Expand Down Expand Up @@ -56,7 +56,7 @@
search-url
{:basic-auth auth-str
:headers {"kbn-xsrf" ""}
:as :json
:as :json-strict
:content-type :json
:throw-exceptions false
:body (json/generate-string
Expand Down Expand Up @@ -90,7 +90,7 @@
search-url
{:basic-auth auth-str
:headers {"kbn-xsrf" ""}
:as :json
:as :json-strict
:content-type :json
:throw-exceptions false
:body (json/generate-string
Expand Down Expand Up @@ -125,7 +125,7 @@
(http/get
(ctia-verdict-url observable)
{:basic-auth auth-str
:as :json
:as :json-strict
:content-type :json
:throw-exceptions false})]
(if (= status 200)
Expand All @@ -151,7 +151,7 @@
search-url
{:basic-auth auth-str
:headers {"kbn-xsrf" ""}
:as :json
:as :json-strict
:content-type :json
:throw-exceptions false
:body (json/generate-string
Expand Down Expand Up @@ -182,7 +182,7 @@
search-url
{:basic-auth auth-str
:headers {"kbn-xsrf" ""}
:as :json
:as :json-strict
:content-type :json
:throw-exceptions false
:body (json/generate-string
Expand Down
2 changes: 1 addition & 1 deletion src/ctia/http/server.clj
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
(defn _http-get [params url jwt]
(log/infof "checkin JWT, GET %s" url)
(http/get url
(into {:as :json
(into {:as :json-strict
:coerce :always
:throw-exceptions false
:headers {:Authorization (format "Bearer %s" jwt)}
Expand Down
2 changes: 1 addition & 1 deletion test/ctia/entity/feed_test.clj
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,7 @@

(let [feed-view-url (:feed_view_url updated-feed)
response (client/get feed-view-url
{:as :json})
{:as :json-strict})
response-body (:body response)]

(is (= 200 (:status response)))
Expand Down
2 changes: 1 addition & 1 deletion test/ctia/entity/web_test.clj
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,7 @@
(str "http://localhost:" (helpers/get-http-port) "/ctia/judgement/" (:short-id judgement-id))
{:headers {"Authorization" (str "Bearer " jwt)}
:throw-exceptions false
:as :json})]
:as :json-strict})]
(:status response)))]
(is (= 201 status))
(testing "GET /ctia/judgement/:id with bad JWT Authorization header"
Expand Down
4 changes: 2 additions & 2 deletions test/ctia/test_helpers/es.clj
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@
(let [{:keys [status]}
(http/post
(url-for-type (-> obj :type keyword))
{:as :json
{:as :json-strict
:content-type :json
:throw-exceptions false
:body (json/generate-string obj)})]
Expand Down Expand Up @@ -190,7 +190,7 @@
(defn get-cat-indices [host port]
(let [url (make-cat-indices-url host
port)
{:keys [body]} (http/get url {:as :json})]
{:keys [body]} (http/get url {:as :json-strict})]
(->> body
(map (fn [{:keys [index]
:as entry}]
Expand Down

0 comments on commit cd54860

Please sign in to comment.