Add request method and path GUCs

This commit is contained in:
steve-chavez
2020-01-21 12:28:05 -05:00
committed by Steve Chavez
parent b20e1150a5
commit 7dade7f466
4 changed files with 25 additions and 2 deletions
+4
View File
@@ -94,6 +94,8 @@ data ApiRequest = ApiRequest {
, iJWT :: Text -- ^ JSON Web Token
, iHeaders :: [(Text, Text)] -- ^ HTTP request headers
, iCookies :: [(Text, Text)] -- ^ Request Cookies
, iPath :: ByteString -- ^ Raw request path
, iMethod :: ByteString -- ^ Raw request method
}
-- | Examines HTTP request and translates it into user intent.
@@ -133,6 +135,8 @@ userApiRequest schema rootSpec req reqBody
, iJWT = tokenStr
, iHeaders = [ (toS $ CI.foldedCase k, toS v) | (k,v) <- hdrs, k /= hCookie]
, iCookies = maybe [] parseCookiesText $ lookupHeader "Cookie"
, iPath = rawPathInfo req
, iMethod = method
}
where
-- queryString with '+' converted to ' '(space)