Skip to content

Commit 4695995

Browse files
committed
Make :ignore-unknown-host use the opt function correctly
1 parent 928ef4c commit 4695995

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

changelog.org

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -379,6 +379,8 @@ List of user-visible changes that have gone into each release
379379
* Work log
380380
Log of merges/issues/work that's gone in so I know what to put in
381381
the changelog for the next release
382+
** 2014-03-05
383+
- fix issue where :ignore-unknown-host wasn't using the =opt= function correctly
382384
** Released 0.9.0
383385
** 2014-02-25
384386
- Bumped httpcore to 4.3.2

src/clj_http/client.clj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -633,12 +633,12 @@
633633
"Middleware ignoring unknown hosts when the :ignore-unknown-host? option
634634
is set."
635635
[client]
636-
(fn [{:keys [ignore-unknown-host?] :as req}]
636+
(fn [req]
637637
(try
638638
(client req)
639639
(catch Exception e
640640
(if (= (type (root-cause e)) UnknownHostException)
641-
(when-not ignore-unknown-host?
641+
(when-not (opt req :ignore-unknown-host)
642642
(throw (root-cause e)))
643643
(throw (root-cause e)))))))
644644

0 commit comments

Comments
 (0)