Fix servant-examples
This commit is contained in:
parent
4d2b96c525
commit
29c445093e
1 changed files with 1 additions and 1 deletions
|
@ -29,7 +29,7 @@ instance HasServer rest => HasServer (AuthProtected :> rest) where
|
||||||
type ServerT (AuthProtected :> rest) m = ServerT rest m
|
type ServerT (AuthProtected :> rest) m = ServerT rest m
|
||||||
|
|
||||||
route Proxy subserver = WithRequest $ \ request ->
|
route Proxy subserver = WithRequest $ \ request ->
|
||||||
route (Proxy :: Proxy rest) $ addAcceptCheck subserver $ cookieCheck request
|
(request, route (Proxy :: Proxy rest) $ addAcceptCheck subserver $ cookieCheck request)
|
||||||
where
|
where
|
||||||
cookieCheck req = case lookup "Cookie" (requestHeaders req) of
|
cookieCheck req = case lookup "Cookie" (requestHeaders req) of
|
||||||
Nothing -> return $ FailFatal err401 { errBody = "Missing auth header" }
|
Nothing -> return $ FailFatal err401 { errBody = "Missing auth header" }
|
||||||
|
|
Loading…
Reference in a new issue