Skip to content

Commit c391311

Browse files
committed
fix mirth version 9 push warning
1 parent 587591a commit c391311

1 file changed

Lines changed: 9 additions & 2 deletions

File tree

src/mirthsync/apis.clj

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@
141141
(defn unexpected-response
142142
[r]
143143
(log/warn "An unexpected response was received from the server...")
144-
(log/warnf "Status: %s, Phrase: %s" (:status r) (:phrase r)))
144+
(log/warnf "Status: %s, Phrase: %s" (:status r) (:reason-phrase r)))
145145

146146
(defn after-push
147147
"Returns a function that takes app-conf and the result of an action
@@ -165,7 +165,14 @@
165165
#(nil? (:body %))))
166166

167167
(def true-200 (after-push #(= 200 (:status %))
168-
#(= "<boolean>true</boolean>" (:body %))))
168+
;; Handle xml, json, or plain text to
169+
;; accommodate different mirth
170+
;; versions. Version 9, for instance,
171+
;; returns json by default.
172+
(fn [{body :body}]
173+
(or (= body "<boolean>true</boolean>")
174+
(= body "{\"boolean\":true}")
175+
(= body "true")))))
169176

170177
(def revision-success
171178
(after-push

0 commit comments

Comments
 (0)