Adopt http-types-0.10

This commit is contained in:
Oleg Grenrus 2017-10-23 08:04:28 +03:00
parent 85929abcc8
commit 6ff70e2cdf
2 changed files with 12 additions and 4 deletions

View file

@ -1,6 +1,5 @@
name: servant-server
version: 0.11
x-revision: 2
version: 0.11.0.1
synopsis: A family of combinators for defining webservices APIs and serving them
description:
A family of combinators for defining webservices APIs and serving them

View file

@ -28,7 +28,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,
@ -65,6 +69,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.
@ -657,7 +666,7 @@ basicAuthApi = Proxy
basicAuthServer :: Server BasicAuthAPI
basicAuthServer =
const (return jerry) :<|>
(Tagged $ \ _ respond -> respond $ responseLBS imATeaPot418 [] "")
(Tagged $ \ _ respond -> respond $ responseLBS imATeapot418 [] "")
basicAuthContext :: Context '[ BasicAuthCheck () ]
basicAuthContext =
@ -702,7 +711,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") = ()