@@ -1,4 +1,5 @@
11{-# LANGUAGE DeriveDataTypeable #-}
2+{-# LANGUAGE OverloadedStrings #-}
23
34module Network.Wai.Handler.Warp.Types where
45
@@ -7,14 +8,29 @@ import Data.ByteString (ByteString)
78import qualified Data.ByteString.Char8 as B
89import Data.Typeable (Typeable)
910import Data.Version (showVersion)
11+import Network.HTTP.Types.Header
1012import qualified Paths_warp
1113
14+----------------------------------------------------------------
15+
1216warpVersion :: String
1317warpVersion = showVersion Paths_warp.version
1418
19+----------------------------------------------------------------
20+
1521-- | TCP port number
1622type Port = Int
1723
24+----------------------------------------------------------------
25+
26+hTransferEncoding :: HeaderName
27+hTransferEncoding = "Transfer-Encoding"
28+
29+hHost :: HeaderName
30+hHost = "Host"
31+
32+----------------------------------------------------------------
33+
1834data InvalidRequest =
1935 NotEnoughLines [String]
2036 | BadFirstLine String
@@ -26,6 +42,8 @@ data InvalidRequest =
2642
2743instance Exception InvalidRequest
2844
45+----------------------------------------------------------------
46+
2947-- |
3048--
3149-- In order to provide slowloris protection, Warp provides timeout handlers. We