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 name: servant-server
version: 0.11 version: 0.11.0.1
x-revision: 2
synopsis: A family of combinators for defining webservices APIs and serving them synopsis: A family of combinators for defining webservices APIs and serving them
description: description:
A family of combinators for defining webservices APIs and serving them 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, methodDelete, methodGet,
methodHead, methodPatch, methodHead, methodPatch,
methodPost, methodPut, ok200, methodPost, methodPut, ok200,
#if MIN_VERSION_http_types(0,10,0)
imATeapot418,
#else
imATeaPot418, imATeaPot418,
#endif
parseQuery) parseQuery)
import Network.Wai (Application, Request, requestHeaders, pathInfo, import Network.Wai (Application, Request, requestHeaders, pathInfo,
queryString, rawQueryString, queryString, rawQueryString,
@ -65,6 +69,11 @@ import Servant.Server.Experimental.Auth
import Servant.Server.Internal.Context import Servant.Server.Internal.Context
(NamedContext(..)) (NamedContext(..))
#if !MIN_VERSION_http_types(0,10,0)
imATeapot418 :: Status
imATeapot418 = imATeaPot418
#endif
-- * comprehensive api test -- * comprehensive api test
-- This declaration simply checks that all instances are in place. -- This declaration simply checks that all instances are in place.
@ -657,7 +666,7 @@ basicAuthApi = Proxy
basicAuthServer :: Server BasicAuthAPI basicAuthServer :: Server BasicAuthAPI
basicAuthServer = basicAuthServer =
const (return jerry) :<|> const (return jerry) :<|>
(Tagged $ \ _ respond -> respond $ responseLBS imATeaPot418 [] "") (Tagged $ \ _ respond -> respond $ responseLBS imATeapot418 [] "")
basicAuthContext :: Context '[ BasicAuthCheck () ] basicAuthContext :: Context '[ BasicAuthCheck () ]
basicAuthContext = basicAuthContext =
@ -702,7 +711,7 @@ genAuthApi = Proxy
genAuthServer :: Server GenAuthAPI genAuthServer :: Server GenAuthAPI
genAuthServer = const (return tweety) genAuthServer = const (return tweety)
:<|> (Tagged $ \ _ respond -> respond $ responseLBS imATeaPot418 [] "") :<|> (Tagged $ \ _ respond -> respond $ responseLBS imATeapot418 [] "")
type instance AuthServerData (AuthProtect "auth") = () type instance AuthServerData (AuthProtect "auth") = ()