Skip to content

Commit 5270814

Browse files
author
ArktinenSieni
committed
renaming, dropping type LbsBackendOptions
1 parent f78bfff commit 5270814

File tree

1 file changed

+8
-11
lines changed

1 file changed

+8
-11
lines changed

src/Servant/Multipart.hs

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -256,9 +256,9 @@ instance ( FromMultipart tag a
256256
-- that allows us to properly clean up the temporary files
257257
-- later on.
258258
check :: MultipartBackend tag => Proxy tag -> MultipartOptions tag -> DelayedIO (MultipartData tag)
259-
check prx tag = withRequest $ \request -> do
259+
check pTag tag = withRequest $ \request -> do
260260
st <- liftResourceT getInternalState
261-
rawData <- liftIO $ parseRequestBodyEx parseOpts (backend prx (options tag) st) request
261+
rawData <- liftIO $ parseRequestBodyEx parseOpts (backend pTag (options tag) st) request
262262
return (fromRaw rawData)
263263
where parseOpts = generalOptions tag
264264

@@ -268,14 +268,14 @@ addMultipartHandling :: forall tag multipart env a. (FromMultipart tag multipart
268268
-> MultipartOptions tag
269269
-> Delayed env (multipart -> a)
270270
-> Delayed env a
271-
addMultipartHandling prx opts subserver =
271+
addMultipartHandling pTag opts subserver =
272272
addBodyCheck subserver contentCheck bodyCheck
273273
where
274274
contentCheck = withRequest $ \request ->
275275
fuzzyMultipartCTCheck (contentTypeH request)
276276

277277
bodyCheck () = do
278-
mpd <- check prx opts :: DelayedIO (MultipartData tag)
278+
mpd <- check pTag opts :: DelayedIO (MultipartData tag)
279279
case fromMultipart mpd of
280280
Nothing -> liftRouteResult $ FailFatal
281281
err400 { errBody = "fromMultipart returned Nothing" }
@@ -345,14 +345,11 @@ instance MultipartBackend Tmp where
345345

346346
instance MultipartBackend Mem where
347347
type MultipartResult Mem = LBS.ByteString
348-
type MultipartBackendOptions Mem = LbsBackendOptions
348+
type MultipartBackendOptions Mem = ()
349349

350-
defaultBackendOptions _ = LbsBackendOptions
350+
defaultBackendOptions _ = ()
351351
backend _ opts _ = lbsBackEnd
352352

353-
-- | TODO: write me
354-
data LbsBackendOptions = LbsBackendOptions
355-
356353
-- | Configuration for the temporary file based backend.
357354
--
358355
-- You can configure the way servant-multipart gets its hands
@@ -378,9 +375,9 @@ defaultTmpBackendOptions = TmpBackendOptions
378375
-- Uses 'defaultParseRequestBodyOptions' and
379376
-- 'defaultTmpBackendOptions' respectively.
380377
defaultMultipartOptions :: MultipartBackend tag => Proxy tag -> MultipartOptions tag
381-
defaultMultipartOptions prx = MultipartOptions
378+
defaultMultipartOptions pTag = MultipartOptions
382379
{ generalOptions = defaultParseRequestBodyOptions
383-
, options = defaultBackendOptions prx
380+
, options = defaultBackendOptions pTag
384381
}
385382

386383
-- Utility class that's like HasContextEntry

0 commit comments

Comments
 (0)