on master help sign in
Added parsed pathInfo and queryString
commit79ff9f429e1998de933bc2337d32bcc7d5852f41 authorMichael Snoyman <michael@snoyman.com> dateThu 10 Mar 2011, 07:33 (16 years ago) parentaddcaed
2 files changed+8−2
Network/Wai.hs+7−2 wai.cabal+1
Network/Wai.hs+7−2
@@ -46,6 +46,7 @@ import Data.Enumerator.Binary (enumFile)
4646import Blaze.ByteString.Builder (Builder, fromByteString, fromLazyByteString)
4747import Network.Socket (SockAddr)
4848import qualified Network.HTTP.Types as H
49+import Data.Text (Text)
4950
5051-- | Information on the request sent by the client. This abstracts away the
5152-- details of the underlying implementation.
@@ -56,9 +57,9 @@ data Request = Request
5657 -- depending on backend; in a standalone server setting, this is most likely
5758 -- all information after the domain name. In a CGI application, this would be
5859 -- the information following the path to the CGI executable itself.
59− , pathInfo :: B.ByteString
60+ , rawPathInfo :: B.ByteString
6061 -- | If no query string was specified, this should be empty.
61− , queryString :: B.ByteString
62+ , rawQueryString :: B.ByteString
6263 , serverName :: B.ByteString
6364 , serverPort :: Int
6465 , requestHeaders :: H.RequestHeaders
@@ -69,6 +70,10 @@ data Request = Request
6970 , errorHandler :: String -> IO ()
7071 -- | The client\'s host information.
7172 , remoteHost :: SockAddr
73+ -- | Path info, broken down into individual components.
74+ , pathInfo :: [Text]
75+ -- | Parsed query string information
76+ , queryString :: H.Query
7277 }
7378 deriving Typeable
7479
wai.cabal+1
@@ -23,5 +23,6 @@ Library
2323 , enumerator >= 0.4.7 && < 0.5
2424 , network >= 2.2 && < 2.4
2525 , http-types >= 0.5 && < 0.6
26+ , text >= 0.5 && < 1.0
2627 Exposed-modules: Network.Wai
2728 ghc-options: -Wall