@@ -1,4 +1,5 @@
1{-# LANGUAGE DeriveDataTypeable #-}
1{-# LANGUAGE DeriveDataTypeable #-}
2+{-# LANGUAGE OverloadedStrings #-}
3module Network.Wai.Handler.Warp.Types where
4module Network.Wai.Handler.Warp.Types where
@@ -7,14 +8,29 @@ import Data.ByteString (ByteString)
7import qualified Data.ByteString.Char8 as B
8import qualified Data.ByteString.Char8 as B
8import Data.Typeable (Typeable)
9import Data.Typeable (Typeable)
9import Data.Version (showVersion)
10import Data.Version (showVersion)
11+import Network.HTTP.Types.Header
10import qualified Paths_warp
12import qualified Paths_warp
14+----------------------------------------------------------------
12warpVersion :: String
16warpVersion :: String
13warpVersion = showVersion Paths_warp.version
17warpVersion = showVersion Paths_warp.version
19+----------------------------------------------------------------
15-- | TCP port number
21-- | TCP port number
16type Port = Int
22type Port = Int
24+----------------------------------------------------------------
26+hTransferEncoding :: HeaderName
27+hTransferEncoding = "Transfer-Encoding"
32+----------------------------------------------------------------
18data InvalidRequest =
34data InvalidRequest =
19 NotEnoughLines [String]
35 NotEnoughLines [String]
20 | BadFirstLine String
36 | BadFirstLine String
@@ -26,6 +42,8 @@ data InvalidRequest =
27instance Exception InvalidRequest
43instance Exception InvalidRequest
45+----------------------------------------------------------------
31-- In order to provide slowloris protection, Warp provides timeout handlers. We
49-- In order to provide slowloris protection, Warp provides timeout handlers. We