remove ghc warnings

This commit is contained in:
Sönke Hahn 2016-10-27 01:37:15 -04:00
parent e9a68cea0c
commit 72a5ec61ba

View file

@ -258,7 +258,9 @@ instance (HasContextEntry context [(SBS.ByteString, User)], HasServer api contex
authWithContext :: (HasContextEntry context [(SBS.ByteString, User)]) => authWithContext :: (HasContextEntry context [(SBS.ByteString, User)]) =>
Context context -> Request -> IO (RouteResult User) Context context -> Request -> IO (RouteResult User)
authWithContext context request = return $ case lookup "Auth" (requestHeaders request) of authWithContext context request = return $ case lookup "Auth" (requestHeaders request) of
Nothing -> FailFatal err401
Just authToken -> case lookup authToken userDict of Just authToken -> case lookup authToken userDict of
Nothing -> FailFatal err403
Just user -> Route user Just user -> Route user
where where
userDict = getContextEntry context userDict = getContextEntry context
@ -285,10 +287,7 @@ data Source = Source (IO SBS.ByteString)
instance HasServer api context => HasServer (StreamRequest :> api) context where instance HasServer api context => HasServer (StreamRequest :> api) context where
type ServerT (StreamRequest :> api) m = Source -> ServerT api m type ServerT (StreamRequest :> api) m = Source -> ServerT api m
route = runServerCombinator $ makeCombinator $ route = runServerCombinator $ makeCombinator $
\ context request -> return $ Route $ getSource $ requestBody request \ _context request -> return $ Route $ Source $ requestBody request
getSource :: IO SBS.ByteString -> Source
getSource = Source
-- * utils -- * utils