Skip to content

Commit

Permalink
Add an HasEndpoint instance for AuthProtect
Browse files Browse the repository at this point in the history
  • Loading branch information
vendethiel committed Nov 24, 2023
1 parent 17a1221 commit 5758335
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions lib/Prometheus/Servant/Internal.hs
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,13 @@ instance ReflectMethod method => HasEndpoint (Verb method status cts a) where
where
method = reflectMethod (Proxy :: Proxy method)

#if MIN_VERSION_servant(0,5,0)
instance HasEndpoint (sub :: Type) => HasEndpoint (AuthProtect a :> sub) where
getEndpoint _ = getEndpoint (Proxy :: Proxy sub)

enumerateEndpoints _ = enumerateEndpoints (Proxy :: Proxy sub)
#endif

#if MIN_VERSION_servant(0,17,0)
instance ReflectMethod method => HasEndpoint (NoContentVerb method) where
getEndpoint _ req = case pathInfo req of
Expand Down

0 comments on commit 5758335

Please sign in to comment.