Skip to content

Commit c92f9a0

Browse files
committed
Remove multipart default store optimization
Performance gains were questionable, and it causes issues when compiled under GraalVM. Fixes #430.
1 parent a01030f commit c92f9a0

File tree

1 file changed

+3
-10
lines changed

1 file changed

+3
-10
lines changed

ring-core/src/ring/middleware/multipart_params.clj

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@
77
88
ring.middleware.multipart-params.byte-array/byte-array-store
99
ring.middleware.multipart-params.temp-file/temp-file-store"
10-
(:require [ring.util.codec :refer [assoc-conj]]
10+
(:require [ring.middleware.multipart-params.temp-file :as tf]
11+
[ring.util.codec :refer [assoc-conj]]
1112
[ring.util.request :as req]
1213
[ring.util.parsing :as parsing])
1314
(:import [org.apache.commons.fileupload
@@ -78,15 +79,7 @@
7879
:stream (.openStream item)}))
7980
(.isFormField item)])
8081

81-
(defn- load-var [sym]
82-
(require (symbol (namespace sym)))
83-
(find-var sym))
84-
85-
(def ^:private default-store
86-
(delay
87-
(let [store 'ring.middleware.multipart-params.temp-file/temp-file-store
88-
func (load-var store)]
89-
(func))))
82+
(def ^:private default-store (delay (tf/temp-file-store)))
9083

9184
(defn- parse-multipart-params
9285
[request {:keys [encoding fallback-encoding store] :as options}]

0 commit comments

Comments
 (0)