Skip to content

Commit 149aac2

Browse files
committed
Multipart: file fix extra
Add a little metadata, reformat imports
1 parent 3f5e16c commit 149aac2

File tree

2 files changed

+20
-18
lines changed

2 files changed

+20
-18
lines changed

src/aleph/http/multipart.clj

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,8 @@
105105
(.flip))))
106106

107107
(defn
108-
^{:deprecated "use aleph.http.multipart/encode-request instead"}
108+
^{:deprecated "0.4.7-alpha2"
109+
:superseded-by "encode-request"}
109110
encode-body
110111
([parts]
111112
(encode-body (boundary) parts))

test/aleph/http/multipart_test.clj

Lines changed: 18 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,23 @@
11
(ns aleph.http.multipart-test
22
(:require
3-
[aleph.http :as http]
4-
[aleph.http.core :as core]
5-
[aleph.http.multipart :as mp]
6-
[byte-streams :as bs]
7-
[clojure.edn :as edn]
8-
[clojure.test :refer [deftest testing is]]
9-
[manifold.deferred :as d]
10-
[manifold.stream :as s]
11-
[clojure.string :as str])
3+
[aleph.http :as http]
4+
[aleph.http.core :as core]
5+
[aleph.http.multipart :as mp]
6+
[byte-streams :as bs]
7+
[clojure.edn :as edn]
8+
[clojure.test :refer [deftest testing is]]
9+
[manifold.deferred :as d]
10+
[manifold.stream :as s]
11+
[clojure.string :as str])
1212
(:import
13-
[io.netty.buffer
14-
ByteBufAllocator]
15-
[io.netty.handler.codec.http
16-
HttpContent]
17-
[io.netty.handler.stream
18-
ChunkedInput]
19-
[java.io
20-
File]))
13+
(io.netty.buffer
14+
ByteBufAllocator)
15+
(io.netty.handler.codec.http
16+
HttpContent)
17+
(io.netty.handler.stream
18+
ChunkedInput)
19+
(java.io
20+
File)))
2121

2222
(def file-to-send (File. (str (System/getProperty "user.dir") "/test/file.txt")))
2323

@@ -125,6 +125,7 @@
125125
body-str (bs/to-string body)]
126126
(validate body-str)
127127
(is (.contains body-str "Content-Transfer-Encoding: base64\r\n"))))
128+
128129
(testing "encode-request"
129130
(let [req (core/ring-request->netty-request {:request-method :get})
130131
[_ body] (mp/encode-request req parts)

0 commit comments

Comments
 (0)