git.iko.soy/typeable/servant
on master help sign in
Merge pull request #541 from mrkkrp/add-has-link-instance-for-basic-auth

Add ‘HasLink’ instance for ‘BasicAuth’

commitaf7391c7a99960c55d5db136666f1996fc6335ad authorJulian Arni <jkarni@gmail.com> dateThu 7 Jul 2016, 18:23 (10 years ago) parentf0d14a79cabc8d
1 file changed+5
servant/src/Servant/Utils/Links.hs+5
servant/src/Servant/Utils/Links.hs+5
@@ -106,6 +106,7 @@ import Prelude ()
106106import Prelude.Compat
107107
108108import Web.HttpApiData
109+import Servant.API.BasicAuth ( BasicAuth )
109110import Servant.API.Capture ( Capture )
110111import Servant.API.ReqBody ( ReqBody )
111112import Servant.API.QueryParam ( QueryParam, QueryParams, QueryFlag )
@@ -291,6 +292,10 @@ instance HasLink sub => HasLink (RemoteHost :> sub) where
291292 type MkLink (RemoteHost :> sub) = MkLink sub
292293 toLink _ = toLink (Proxy :: Proxy sub)
293294
295+instance HasLink sub => HasLink (BasicAuth realm a :> sub) where
296+ type MkLink (BasicAuth realm a :> sub) = MkLink sub
297+ toLink _ = toLink (Proxy :: Proxy sub)
298+
294299-- Verb (terminal) instances
295300instance HasLink (Verb m s ct a) where
296301 type MkLink (Verb m s ct a) = URI