git.iko.soy/typeable/servant
on master help sign in
Add ReflectMethod instances for OPTIONS, TRACE, and CONNECT
commitba57d2000895ca223825f785f1cebe2c9d76ebef authorAndrew Gibiansky <andrew.gibiansky@gmail.com> dateTue 5 Apr 2016, 17:30 (11 years ago) parent21822be
1 file changed+12−1
servant/src/Servant/API/Verbs.hs+12−1
servant/src/Servant/API/Verbs.hs+12−1
@@ -14,7 +14,9 @@ import GHC.Generics (Generic)
1414import GHC.TypeLits (Nat)
1515import Network.HTTP.Types.Method (Method, StdMethod (..),
1616 methodDelete, methodGet, methodHead,
17− methodPatch, methodPost, methodPut)
17+ methodPatch, methodPost, methodPut,
18+ methodTrace, methodConnect,
19+ methodOptions)
1820
1921-- | @Verb@ is a general type for representing HTTP verbs (a.k.a. methods). For
2022-- convenience, type synonyms for each verb with a 200 response code are
@@ -167,3 +169,12 @@ instance ReflectMethod 'PATCH where
167169
168170instance ReflectMethod 'HEAD where
169171 reflectMethod _ = methodHead
172+
173+instance ReflectMethod 'OPTIONS where
174+ reflectMethod _ = methodOptions
175+
176+instance ReflectMethod 'TRACE where
177+ reflectMethod _ = methodTrace
178+
179+instance ReflectMethod 'CONNECT where
180+ reflectMethod _ = methodConnect