File tree Expand file tree Collapse file tree 2 files changed +20
-18
lines changed Expand file tree Collapse file tree 2 files changed +20
-18
lines changed Original file line number Diff line number Diff line change 105
105
(.flip ))))
106
106
107
107
(defn
108
- ^{:deprecated " use aleph.http.multipart/encode-request instead" }
108
+ ^{:deprecated " 0.4.7-alpha2"
109
+ :superseded-by " encode-request" }
109
110
encode-body
110
111
([parts]
111
112
(encode-body (boundary ) parts))
Original file line number Diff line number Diff line change 1
1
(ns aleph.http.multipart-test
2
2
(: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])
12
12
(: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) ))
21
21
22
22
(def file-to-send (File. (str (System/getProperty " user.dir" ) " /test/file.txt" )))
23
23
125
125
body-str (bs/to-string body)]
126
126
(validate body-str)
127
127
(is (.contains body-str " Content-Transfer-Encoding: base64\r\n " ))))
128
+
128
129
(testing " encode-request"
129
130
(let [req (core/ring-request->netty-request {:request-method :get })
130
131
[_ body] (mp/encode-request req parts)
You can’t perform that action at this time.
0 commit comments