Adopt http-types-0.10

This commit is contained in:
Oleg Grenrus 2017-10-23 08:04:28 +03:00
parent 2d6bf5055b
commit 09485871f5

View File

@ -33,7 +33,11 @@ import Network.HTTP.Types (Status (..), hAccept, hContentType,
methodDelete, methodGet,
methodHead, methodPatch,
methodPost, methodPut, ok200,
#if MIN_VERSION_http_types(0,10,0)
imATeapot418,
#else
imATeaPot418,
#endif
parseQuery)
import Network.Wai (Application, Request, requestHeaders, pathInfo,
queryString, rawQueryString,
@ -70,6 +74,11 @@ import Servant.Server.Experimental.Auth
import Servant.Server.Internal.Context
(NamedContext(..))
#if !MIN_VERSION_http_types(0,10,0)
imATeapot418 :: Status
imATeapot418 = imATeaPot418
#endif
-- * comprehensive api test
-- This declaration simply checks that all instances are in place.
@ -662,7 +671,7 @@ basicAuthApi = Proxy
basicAuthServer :: Server BasicAuthAPI
basicAuthServer =
const (return jerry) :<|>
(Tagged $ \ _ respond -> respond $ responseLBS imATeaPot418 [] "")
(Tagged $ \ _ respond -> respond $ responseLBS imATeapot418 [] "")
basicAuthContext :: Context '[ BasicAuthCheck () ]
basicAuthContext =
@ -707,7 +716,7 @@ genAuthApi = Proxy
genAuthServer :: Server GenAuthAPI
genAuthServer = const (return tweety)
:<|> (Tagged $ \ _ respond -> respond $ responseLBS imATeaPot418 [] "")
:<|> (Tagged $ \ _ respond -> respond $ responseLBS imATeapot418 [] "")
type instance AuthServerData (AuthProtect "auth") = ()