From ca6944b8d725e7bb1de551da421e5b5d405836fe Mon Sep 17 00:00:00 2001 From: Anurag Ohri Date: Tue, 22 Aug 2023 19:36:48 +0530 Subject: [PATCH] Add add set cookies instance (#1702) * Add AddSetCookies instance for when the left tree is the same before and after the transformation * Added changelog * Updated the changelog --- changelog.d/1702 | 3 +++ .../src/Servant/Auth/Server/Internal/AddSetCookie.hs | 5 +++++ 2 files changed, 8 insertions(+) create mode 100644 changelog.d/1702 diff --git a/changelog.d/1702 b/changelog.d/1702 new file mode 100644 index 000000000..6c0318cf5 --- /dev/null +++ b/changelog.d/1702 @@ -0,0 +1,3 @@ +synopsis: Add AddSetCookies instance for when the left tree is the same before and after the transformation. +prs: #1702 +issues: #1601 diff --git a/servant-auth/servant-auth-server/src/Servant/Auth/Server/Internal/AddSetCookie.hs b/servant-auth/servant-auth-server/src/Servant/Auth/Server/Internal/AddSetCookie.hs index 985ec08b1..2b23797fa 100644 --- a/servant-auth/servant-auth-server/src/Servant/Auth/Server/Internal/AddSetCookie.hs +++ b/servant-auth/servant-auth-server/src/Servant/Auth/Server/Internal/AddSetCookie.hs @@ -86,6 +86,11 @@ instance {-# OVERLAPS #-} => AddSetCookies ('S n) (a :<|> b) (a' :<|> b') where addSetCookies cookies (a :<|> b) = addSetCookies cookies a :<|> addSetCookies cookies b +instance {-# OVERLAPPING #-} + (AddSetCookies ('S n) a a, AddSetCookies ('S n) b b') + => AddSetCookies ('S n) (a :<|> b) (a :<|> b') where + addSetCookies cookies ( a :<|> b) = addSetCookies cookies a :<|> addSetCookies cookies b + instance {-# OVERLAPS #-} ( AddSetCookies ('S n) (ServerT (ToServantApi api) m) cookiedApi , Generic (api (AsServerT m))