Skip to content

Commit

Permalink
Add an HasEndpoint instance for AuthProtect (#5)
Browse files Browse the repository at this point in the history
  • Loading branch information
vendethiel authored Dec 14, 2023
1 parent 80c6457 commit af99252
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 af99252

Please sign in to comment.