diff --git a/servant/CHANGELOG.md b/servant/CHANGELOG.md index 9ae7547e..e4f51e8c 100644 --- a/servant/CHANGELOG.md +++ b/servant/CHANGELOG.md @@ -2,6 +2,7 @@ HEAD ---- * Add `HttpVersion`, `IsSecure`, `RemoteHost` and `Vault` combinators +* Fix safeLink, so Header is not in fact required. 0.4.2 ----- diff --git a/servant/src/Servant/Utils/Links.hs b/servant/src/Servant/Utils/Links.hs index 19fdc019..7224ff79 100644 --- a/servant/src/Servant/Utils/Links.hs +++ b/servant/src/Servant/Utils/Links.hs @@ -166,7 +166,7 @@ type family IsElem' a s :: Constraint type family IsElem endpoint api :: Constraint where IsElem e (sa :<|> sb) = Or (IsElem e sa) (IsElem e sb) IsElem (e :> sa) (e :> sb) = IsElem sa sb - IsElem sa (Header x :> sb) = IsElem sa sb + IsElem sa (Header sym x :> sb) = IsElem sa sb IsElem sa (ReqBody y x :> sb) = IsElem sa sb IsElem (Capture z y :> sa) (Capture x y :> sb) = IsElem sa sb diff --git a/servant/test/Servant/Utils/LinksSpec.hs b/servant/test/Servant/Utils/LinksSpec.hs index 16f13925..07aeb051 100644 --- a/servant/test/Servant/Utils/LinksSpec.hs +++ b/servant/test/Servant/Utils/LinksSpec.hs @@ -25,7 +25,7 @@ type TestApi = :<|> "get" :> Get '[JSON] () :<|> "put" :> Put '[JSON] () :<|> "post" :> ReqBody '[JSON] 'True :> Post '[JSON] () - :<|> "delete" :> Header "ponies" :> Delete '[JSON] () + :<|> "delete" :> Header "ponies" String :> Delete '[JSON] () :<|> "raw" :> Raw type TestLink = "hello" :> "hi" :> Get '[JSON] Bool