Adopt http-types-0.10
This commit is contained in:
parent
2d6bf5055b
commit
09485871f5
1 changed files with 11 additions and 2 deletions
|
@ -33,7 +33,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,
|
||||||
|
@ -70,6 +74,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.
|
||||||
|
@ -662,7 +671,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 =
|
||||||
|
@ -707,7 +716,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") = ()
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue