Fix servant-examples

This commit is contained in:
Nickolay Kudasov 2016-01-20 19:05:32 +03:00
parent 4d2b96c525
commit 29c445093e

View file

@ -29,7 +29,7 @@ instance HasServer rest => HasServer (AuthProtected :> rest) where
type ServerT (AuthProtected :> rest) m = ServerT rest m
route Proxy subserver = WithRequest $ \ request ->
route (Proxy :: Proxy rest) $ addAcceptCheck subserver $ cookieCheck request
(request, route (Proxy :: Proxy rest) $ addAcceptCheck subserver $ cookieCheck request)
where
cookieCheck req = case lookup "Cookie" (requestHeaders req) of
Nothing -> return $ FailFatal err401 { errBody = "Missing auth header" }