Hello, I was doing a tutorial about a generalized authentication (LINK), I have found one strange thing.
The pathInfo req
command returns an empty list. Even if I go to the paths such as “a/b/c”, the pathInfo is still an empty list. Why? Probably the AuthHandler has already removed the Path from the request, and therefore the pathInfo is always empty here?
import Network.Wai (Request, pathInfo)
describeRequest :: Request -> IO ()
describeRequest req = do
let urlParts = pathInfo req
print urlParts
I call this describeRequest
function inside this authHandler
(shortened for clarity):
authHandler :: PostgresConnection -> AuthHandler Request User
authHandler conn = mkAuthHandler handler
where
handler req = do
...
liftIO $ describeRequest req
...