Skip to content

Commit 7c981b3

Browse files
author
ArktinenSieni
committed
'options' -> 'backendOptions', cleaning
1 parent 3c367f5 commit 7c981b3

File tree

1 file changed

+15
-7
lines changed

1 file changed

+15
-7
lines changed

src/Servant/Multipart.hs

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,8 @@ data MultipartData tag = MultipartData
155155
, files :: [FileData tag]
156156
}
157157

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
159160
fromRaw (inputs, files) = MultipartData is fs
160161

161162
where is = map (\(name, val) -> Input (dec name) (dec val)) inputs
@@ -259,10 +260,17 @@ instance ( FromMultipart tag a
259260
-- returning the data as well as the resourcet InternalState
260261
-- that allows us to properly clean up the temporary files
261262
-- 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)
263267
check pTag tag = withRequest $ \request -> do
264268
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
266274
return (fromRaw rawData)
267275
where parseOpts = generalOptions tag
268276

@@ -309,7 +317,7 @@ fuzzyMultipartCTCheck ct
309317
--
310318
-- 'generalOptions' lets you specify mostly multipart parsing
311319
-- 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
313321
-- backend. Note: there isn't anything to tweak in a memory
314322
-- backend ('Mem'). Maximum file size etc. options are in
315323
-- 'ParseRequestBodyOptions'.
@@ -318,8 +326,8 @@ fuzzyMultipartCTCheck ct
318326
-- 'TmpBackendOptions' respectively for more information on
319327
-- what you can tweak.
320328
data MultipartOptions tag = MultipartOptions
321-
{ generalOptions :: ParseRequestBodyOptions
322-
, options :: MultipartBackendOptions tag
329+
{ generalOptions :: ParseRequestBodyOptions
330+
, backendOptions :: MultipartBackendOptions tag
323331
}
324332

325333
class MultipartBackend tag where
@@ -385,7 +393,7 @@ defaultTmpBackendOptions = TmpBackendOptions
385393
defaultMultipartOptions :: MultipartBackend tag => Proxy tag -> MultipartOptions tag
386394
defaultMultipartOptions pTag = MultipartOptions
387395
{ generalOptions = defaultParseRequestBodyOptions
388-
, options = defaultBackendOptions pTag
396+
, backendOptions = defaultBackendOptions pTag
389397
}
390398

391399
-- Utility class that's like HasContextEntry

0 commit comments

Comments
 (0)