@@ -34,8 +34,6 @@ import Data.Maybe (isJust, fromJust, fromMaybe)
3434
3535import Data.Typeable (Typeable)
3636
37−import qualified Web.Encodings.StringLike as SL
38−
3937import Network.Socket.SendFile
4038import Control.Arrow (first)
4139
@@ -136,7 +134,7 @@ parseRequest port lines' handle remoteHost' = do
136134parseFirst :: ByteString
137135 -> IO (ByteString, ByteString, ByteString, HttpVersion)
138136parseFirst s = do
139− let pieces = SL.split ' ' s
137+ let pieces = B.words s
140138 (method, query, http') <-
141139 case pieces of
142140 [x, y, z] -> return (x, y, z)
@@ -173,4 +171,10 @@ sendResponse httpversion h res = do
173171parseHeaderNoAttr :: ByteString -> (ByteString, ByteString)
174172parseHeaderNoAttr s =
175173 let (k, rest) = B.span (/= ':') s
176− in (k, SL.dropPrefix' (B.pack ": ") rest)
174+ rest' = if not (B.null rest) &&
175+ B.head rest == ':' &&
176+ not (B.null $ B.tail rest) &&
177+ B.head (B.tail rest) == ' '
178+ then B.drop 2 rest
179+ else rest
180+ in (k, rest')