@@ -155,7 +155,8 @@ data MultipartData tag = MultipartData
155
155
, files :: [FileData tag ]
156
156
}
157
157
158
- fromRaw :: forall tag . ([Network.Wai.Parse. Param ], [File (MultipartResult tag )]) -> MultipartData tag
158
+ fromRaw :: forall tag . ([Network.Wai.Parse. Param ], [File (MultipartResult tag )])
159
+ -> MultipartData tag
159
160
fromRaw (inputs, files) = MultipartData is fs
160
161
161
162
where is = map (\ (name, val) -> Input (dec name) (dec val)) inputs
@@ -259,10 +260,17 @@ instance ( FromMultipart tag a
259
260
-- returning the data as well as the resourcet InternalState
260
261
-- that allows us to properly clean up the temporary files
261
262
-- later on.
262
- check :: MultipartBackend tag => Proxy tag -> MultipartOptions tag -> DelayedIO (MultipartData tag )
263
+ check :: MultipartBackend tag
264
+ => Proxy tag
265
+ -> MultipartOptions tag
266
+ -> DelayedIO (MultipartData tag )
263
267
check pTag tag = withRequest $ \ request -> do
264
268
st <- liftResourceT getInternalState
265
- rawData <- liftIO $ parseRequestBodyEx parseOpts (backend pTag (options tag) st) request
269
+ rawData <- liftIO
270
+ $ parseRequestBodyEx
271
+ parseOpts
272
+ (backend pTag (backendOptions tag) st)
273
+ request
266
274
return (fromRaw rawData)
267
275
where parseOpts = generalOptions tag
268
276
@@ -309,7 +317,7 @@ fuzzyMultipartCTCheck ct
309
317
--
310
318
-- 'generalOptions' lets you specify mostly multipart parsing
311
319
-- related options, such as the maximum file size, while
312
- -- 'options ' lets you configure aspects specific to the chosen
320
+ -- 'backendOptions ' lets you configure aspects specific to the chosen
313
321
-- backend. Note: there isn't anything to tweak in a memory
314
322
-- backend ('Mem'). Maximum file size etc. options are in
315
323
-- 'ParseRequestBodyOptions'.
@@ -318,8 +326,8 @@ fuzzyMultipartCTCheck ct
318
326
-- 'TmpBackendOptions' respectively for more information on
319
327
-- what you can tweak.
320
328
data MultipartOptions tag = MultipartOptions
321
- { generalOptions :: ParseRequestBodyOptions
322
- , options :: MultipartBackendOptions tag
329
+ { generalOptions :: ParseRequestBodyOptions
330
+ , backendOptions :: MultipartBackendOptions tag
323
331
}
324
332
325
333
class MultipartBackend tag where
@@ -385,7 +393,7 @@ defaultTmpBackendOptions = TmpBackendOptions
385
393
defaultMultipartOptions :: MultipartBackend tag => Proxy tag -> MultipartOptions tag
386
394
defaultMultipartOptions pTag = MultipartOptions
387
395
{ generalOptions = defaultParseRequestBodyOptions
388
- , options = defaultBackendOptions pTag
396
+ , backendOptions = defaultBackendOptions pTag
389
397
}
390
398
391
399
-- Utility class that's like HasContextEntry
0 commit comments