Skip to content

Commit

Permalink
Merge pull request #111 from slava92/body-before-headers
Browse files Browse the repository at this point in the history
Body before headers
  • Loading branch information
drewr authored Jan 27, 2021
2 parents d2ad4de + e162005 commit 7606a66
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion project.clj
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,5 @@
:1.7 {:dependencies [[org.clojure/clojure "1.7.0"]]}
:1.8 {:dependencies [[org.clojure/clojure "1.8.0"]]}
:1.9 {:dependencies [[org.clojure/clojure "1.9.0"]]}
:1.10 {:dependencies [[org.clojure/clojure "1.10.2-rc1"]]}}
:1.10 {:dependencies [[org.clojure/clojure "1.10.2"]]}}
:aliases {"test-all" ["with-profile" "dev,1.7:dev,1.8:dev,1.9:dev,1.10" "test"]})
2 changes: 1 addition & 1 deletion src/postal/message.clj
Original file line number Diff line number Diff line change
Expand Up @@ -195,8 +195,8 @@
(.setSubject (:subject msg) ^String charset)
(.setSentDate (or (:date msg) (make-date)))
(.addHeader "User-Agent" (:user-agent msg (user-agent)))
(add-extra! (apply dissoc msg standard))
(add-body! (:body msg) charset)
(add-extra! (apply dissoc msg standard))
(.saveChanges)))))

(defn make-fixture [from to & {:keys [tag]}]
Expand Down
6 changes: 4 additions & 2 deletions test/postal/test/message.clj
Original file line number Diff line number Diff line change
Expand Up @@ -199,8 +199,10 @@
:to "[email protected]"
:subject "Test"
:User-Agent "Lorem Ipsum"
:body "Foo!"}]
(is (.contains (message->str m) "User-Agent: Lorem Ipsum"))))
:Content-Type "text/html"
:body "<html><body>Foo!</body></html>"}]
(is (.contains (message->str m) "User-Agent: Lorem Ipsum"))
(is (= (.getContentType (make-jmessage m)) "text/html"))))

(deftest test-bad-addrs
(let [m (message->str
Expand Down

0 comments on commit 7606a66

Please sign in to comment.