Fix isElem for Header.
The intention was obviously to ignore them, but we weren't doing so
correctly.
commit29e3c1a45a17c663c8891792743c8057c594ee6a
authorJulian K. Arni <jkarni@gmail.com>
dateTue 21 Jul 2015, 15:22 (11 years ago)
parent3209f98
servant/CHANGELOG.md+1
@@ -2,6 +2,7 @@ HEAD
22----
33
44* Add `HttpVersion`, `IsSecure`, `RemoteHost` and `Vault` combinators
5+* Fix safeLink, so Header is not in fact required.
56
670.4.2
78-----
servant/src/Servant/Utils/Links.hs+1−1
@@ -166,7 +166,7 @@ type family IsElem' a s :: Constraint
166166type family IsElem endpoint api :: Constraint where
167167 IsElem e (sa :<|> sb) = Or (IsElem e sa) (IsElem e sb)
168168 IsElem (e :> sa) (e :> sb) = IsElem sa sb
169− IsElem sa (Header x :> sb) = IsElem sa sb
169+ IsElem sa (Header sym x :> sb) = IsElem sa sb
170170 IsElem sa (ReqBody y x :> sb) = IsElem sa sb
171171 IsElem (Capture z y :> sa) (Capture x y :> sb)
172172 = IsElem sa sb
servant/test/Servant/Utils/LinksSpec.hs+1−1
@@ -25,7 +25,7 @@ type TestApi =
2525 :<|> "get" :> Get '[JSON] ()
2626 :<|> "put" :> Put '[JSON] ()
2727 :<|> "post" :> ReqBody '[JSON] 'True :> Post '[JSON] ()
28− :<|> "delete" :> Header "ponies" :> Delete '[JSON] ()
28+ :<|> "delete" :> Header "ponies" String :> Delete '[JSON] ()
2929 :<|> "raw" :> Raw
3030
3131type TestLink = "hello" :> "hi" :> Get '[JSON] Bool