From 72a5ec61ba3538cb127b19e8b4723b4f5c550ec9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=B6nke=20Hahn?= Date: Thu, 27 Oct 2016 01:37:15 -0400 Subject: [PATCH] remove ghc warnings --- .../test/Servant/Server/Utils/CustomCombinatorsSpec.hs | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/servant-server/test/Servant/Server/Utils/CustomCombinatorsSpec.hs b/servant-server/test/Servant/Server/Utils/CustomCombinatorsSpec.hs index 3008fa22..b816e180 100644 --- a/servant-server/test/Servant/Server/Utils/CustomCombinatorsSpec.hs +++ b/servant-server/test/Servant/Server/Utils/CustomCombinatorsSpec.hs @@ -258,7 +258,9 @@ instance (HasContextEntry context [(SBS.ByteString, User)], HasServer api contex authWithContext :: (HasContextEntry context [(SBS.ByteString, User)]) => Context context -> Request -> IO (RouteResult User) authWithContext context request = return $ case lookup "Auth" (requestHeaders request) of + Nothing -> FailFatal err401 Just authToken -> case lookup authToken userDict of + Nothing -> FailFatal err403 Just user -> Route user where userDict = getContextEntry context @@ -285,10 +287,7 @@ data Source = Source (IO SBS.ByteString) instance HasServer api context => HasServer (StreamRequest :> api) context where type ServerT (StreamRequest :> api) m = Source -> ServerT api m route = runServerCombinator $ makeCombinator $ - \ context request -> return $ Route $ getSource $ requestBody request - -getSource :: IO SBS.ByteString -> Source -getSource = Source + \ _context request -> return $ Route $ Source $ requestBody request -- * utils