Permalink
|
@@ -1,6 +1,6 @@ |
|
(ns ring.middleware.multipart-params
|
|
(ns ring.middleware.multipart-params
|
|
"Parse multipart upload into params."
|
|
"Parse multipart upload into params."
|
|
- (:use [ring.util.data :only (assoc+)])
|
|
+ (:use [ring.util.data :only (assoc-conj)])
|
|
(:import [org.apache.commons.fileupload.util Streams]
|
|
(:import [org.apache.commons.fileupload.util Streams]
|
|
[org.apache.commons.fileupload
|
|
[org.apache.commons.fileupload
|
|
RequestContext
|
|
RequestContext
|
|
|
@@ -54,7 +54,7 @@ |
|
(->> (request-context request encoding)
|
|
(->> (request-context request encoding)
|
|
(file-item-seq)
|
|
(file-item-seq)
|
|
(map #(parse-file-item % store))
|
|
(map #(parse-file-item % store))
|
|
- (reduce (fn [m [k v]] (assoc+ m k v)) {})))
|
|
+ (reduce (fn [m [k v]] (assoc-conj m k v)) {})))
|
|
|
|
|
|
(defn- load-var
|
|
(defn- load-var
|
|
"Returns the var named by the supplied symbol, or nil if not found. Attempts
|
|
"Returns the var named by the supplied symbol, or nil if not found. Attempts
|
|
|
|
|
|
@@ -107,7 +107,7 @@ |
|
(reduce
|
|
(reduce
|
|
(fn [m param]
|
|
(fn [m param]
|
|
(if-let [[k v] (str/split param #"=" 2)]
|
|
(if-let [[k v] (str/split param #"=" 2)]
|
|
- (assoc+ m (form-decode-str k encoding) (form-decode-str v encoding))
|
|
+ (assoc-conj m (form-decode-str k encoding) (form-decode-str v encoding))
|
|
m))
|
|
m))
|
|
{}
|
|
{}
|
|
(str/split encoded #"&"))))
|
|
(str/split encoded #"&"))))
|
|
@@ -1,7 +1,7 @@ |
|
(ns ring.util.data
|
|
(ns ring.util.data
|
|
"Miscellaneous functions for manipulating data structures.")
|
|
"Miscellaneous functions for manipulating data structures.")
|
|
|
|
|
|
-(defn assoc+
|
|
+(defn assoc-conj
|
|
"Associate a key with a value in a map. If the key already exists in the map,
|
|
"Associate a key with a value in a map. If the key already exists in the map,
|
|
a vector of values is associated with the key."
|
|
a vector of values is associated with the key."
|
|
[map key val]
|
|
[map key val]
|
|
|
|
0 comments on commit
7f42a8e