@@ -593,12 +593,14 @@ basicAuthSpec = do
593593------------------------------------------------------------------------------
594594
595595type GenAuthAPI = AuthProtect "auth" :> "auth" :> Get '[JSON] Animal
596+ :<|> Raw
596597
597−authApi :: Proxy GenAuthAPI
598−authApi = Proxy
598+genAuthApi :: Proxy GenAuthAPI
599+genAuthApi = Proxy
599600
600−authServer :: Server GenAuthAPI
601−authServer = const (return tweety)
601+genAuthServer :: Server GenAuthAPI
602+genAuthServer = const (return tweety)
603+ :<|> (\ _ respond -> respond $ responseLBS imATeaPot418 [] "")
602604
603605type instance AuthServerData (AuthProtect "auth") = ()
604606
@@ -614,7 +616,7 @@ genAuthContext =
614616genAuthSpec :: Spec
615617genAuthSpec = do
616618 describe "Servant.API.Auth" $ do
617− with (return (serveWithContext authApi genAuthContext authServer)) $ do
619+ with (return (serveWithContext genAuthApi genAuthContext genAuthServer)) $ do
618620
619621 context "Custom Auth Protection" $ do
620622 it "returns 401 when missing headers" $ do
@@ -623,6 +625,9 @@ genAuthSpec = do
623625 it "returns 200 with the right header" $ do
624626 THW.request methodGet "/auth" [("Auth","secret")] "" `shouldRespondWith` 200
625627
628+ it "plays nice with subsequent Raw endpoints" $ do
629+ get "/foo" `shouldRespondWith` 418
630+
626631-- }}}
627632------------------------------------------------------------------------------
628633-- * Test data types {{{