on master help sign in
Merge pull request #273 from DaveCTurner/master
d6e889eMichael Snoyman
wai/Network/Wai.hs+1−1
@@ -190,7 +190,7 @@ responseHeaders (ResponseBuilder _ hs _ ) = hs
190responseHeaders (ResponseStream _ hs _ ) = hs
190responseHeaders (ResponseStream _ hs _ ) = hs
191responseHeaders (ResponseRaw _ res) = responseHeaders res
191responseHeaders (ResponseRaw _ res) = responseHeaders res
192
192
193−-- | Converting the body information in 'Response' to a @StreamingBody@.
193+-- | Converting the body information in 'Response' to a 'StreamingBody'.
194responseToStream :: Response
194responseToStream :: Response
195 -> ( H.Status
195 -> ( H.Status
196 , H.ResponseHeaders
196 , H.ResponseHeaders
wai/Network/Wai/Internal.hs+6−6
@@ -30,9 +30,9 @@ data Request = Request {
30 , rawPathInfo :: B.ByteString
30 , rawPathInfo :: B.ByteString
31 -- | If no query string was specified, this should be empty. This value
31 -- | If no query string was specified, this should be empty. This value
32 -- /will/ include the leading question mark.
32 -- /will/ include the leading question mark.
33− -- Do not modify this raw value- modify queryString instead.
33+ -- Do not modify this raw value - modify queryString instead.
34 , rawQueryString :: B.ByteString
34 , rawQueryString :: B.ByteString
35− -- | A list of header (a pair of key and value) in an HTTP request.
35+ -- | A list of headers (a pair of key and value) in an HTTP request.
36 , requestHeaders :: H.RequestHeaders
36 , requestHeaders :: H.RequestHeaders
37 -- | Was this request made over an SSL connection?
37 -- | Was this request made over an SSL connection?
38 --
38 --
@@ -40,17 +40,17 @@ data Request = Request {
40 -- this request over SSL, but rather whether the current connection is SSL.
40 -- this request over SSL, but rather whether the current connection is SSL.
41 -- The distinction lies with reverse proxies. In many cases, the client will
41 -- The distinction lies with reverse proxies. In many cases, the client will
42 -- connect to a load balancer over SSL, but connect to the WAI handler
42 -- connect to a load balancer over SSL, but connect to the WAI handler
43− -- without SSL. In such a case, @isSecure@ will be @False@, but from a user
43+ -- without SSL. In such a case, 'isSecure' will be 'False', but from a user
44 -- perspective, there is a secure connection.
44 -- perspective, there is a secure connection.
45 , isSecure :: Bool
45 , isSecure :: Bool
46 -- | The client\'s host information.
46 -- | The client\'s host information.
47 , remoteHost :: SockAddr
47 , remoteHost :: SockAddr
48− -- | Path info in individual pieces- the url without a hostname/port and
48+ -- | Path info in individual pieces - the URL without a hostname/port and
49 -- without a query string, split on forward slashes.
49 -- without a query string, split on forward slashes.
50 , pathInfo :: [Text]
50 , pathInfo :: [Text]
51− -- | Parsed query string information
51+ -- | Parsed query string information.
52 , queryString :: H.Query
52 , queryString :: H.Query
53− -- | Get the next chunk of the body. Returns an empty bytestring when the
53+ -- | Get the next chunk of the body. Returns 'B.empty' when the
54 -- body is fully consumed.
54 -- body is fully consumed.
55 , requestBody :: IO B.ByteString
55 , requestBody :: IO B.ByteString
56 -- | A location for arbitrary data to be shared by applications and middleware.
56 -- | A location for arbitrary data to be shared by applications and middleware.
warp/Network/Wai/Handler/Warp.hs+4−4
@@ -119,7 +119,7 @@ setHost x y = y { settingsHost = x }
119setOnException :: (Maybe Request -> SomeException -> IO ()) -> Settings -> Settings
119setOnException :: (Maybe Request -> SomeException -> IO ()) -> Settings -> Settings
120setOnException x y = y { settingsOnException = x }
120setOnException x y = y { settingsOnException = x }
121
121
122−-- | A function to create `Response` when an exception occurs.
122+-- | A function to create a `Response` when an exception occurs.
123--
123--
124-- Default: 500, text/plain, \"Something went wrong\"
124-- Default: 500, text/plain, \"Something went wrong\"
125--
125--
@@ -127,7 +127,7 @@ setOnException x y = y { settingsOnException = x }
127setOnExceptionResponse :: (SomeException -> Response) -> Settings -> Settings
127setOnExceptionResponse :: (SomeException -> Response) -> Settings -> Settings
128setOnExceptionResponse x y = y { settingsOnExceptionResponse = x }
128setOnExceptionResponse x y = y { settingsOnExceptionResponse = x }
129
129
130−-- | What to do when a connection is open. When 'False' is returned, the
130+-- | What to do when a connection is opened. When 'False' is returned, the
131-- connection is closed immediately. Otherwise, the connection is going on.
131-- connection is closed immediately. Otherwise, the connection is going on.
132-- Default: always returns 'True'.
132-- Default: always returns 'True'.
133--
133--
@@ -135,7 +135,7 @@ setOnExceptionResponse x y = y { settingsOnExceptionResponse = x }
135setOnOpen :: (SockAddr -> IO Bool) -> Settings -> Settings
135setOnOpen :: (SockAddr -> IO Bool) -> Settings -> Settings
136setOnOpen x y = y { settingsOnOpen = x }
136setOnOpen x y = y { settingsOnOpen = x }
137
137
138−-- | What to do when a connection is close. Default: do nothing.
138+-- | What to do when a connection is closed. Default: do nothing.
139--
139--
140-- Since 2.1.0
140-- Since 2.1.0
141setOnClose :: (SockAddr -> IO ()) -> Settings -> Settings
141setOnClose :: (SockAddr -> IO ()) -> Settings -> Settings
@@ -154,7 +154,7 @@ setTimeout x y = y { settingsTimeout = x }
154setManager :: Manager -> Settings -> Settings
154setManager :: Manager -> Settings -> Settings
155setManager x y = y { settingsManager = Just x }
155setManager x y = y { settingsManager = Just x }
156
156
157−-- | Cache duratoin time of file descriptors in seconds. 0 means that the cache mechanism is not used. Default value: 10
157+-- | Cache duration time of file descriptors in seconds. 0 means that the cache mechanism is not used. Default value: 10
158setFdCacheDuration :: Int -> Settings -> Settings
158setFdCacheDuration :: Int -> Settings -> Settings
159setFdCacheDuration x y = y { settingsFdCacheDuration = x }
159setFdCacheDuration x y = y { settingsFdCacheDuration = x }
160
160
warp/Network/Wai/Handler/Warp/Settings.hs+2−2
@@ -22,9 +22,9 @@ import qualified Data.Text.Lazy.Encoding as TLE
22-- | Various Warp server settings. This is purposely kept as an abstract data
22-- | Various Warp server settings. This is purposely kept as an abstract data
23-- type so that new settings can be added without breaking backwards
23-- type so that new settings can be added without breaking backwards
24-- compatibility. In order to create a 'Settings' value, use 'defaultSettings'
24-- compatibility. In order to create a 'Settings' value, use 'defaultSettings'
25−-- and record syntax to modify individual records. For example:
25+-- and the various \'set\' functions to modify individual fields. For example:
26--
26--
27−-- > defaultSettings { settingsTimeout = 20 }
27+-- > setTimeout 20 defaultSettings
28data Settings = Settings
28data Settings = Settings
29 { settingsPort :: Int -- ^ Port to listen on. Default value: 3000
29 { settingsPort :: Int -- ^ Port to listen on. Default value: 3000
30 , settingsHost :: HostPreference -- ^ Default value: HostIPv4
30 , settingsHost :: HostPreference -- ^ Default value: HostIPv4