on master help sign in
Using proper type.
4883f84Kazu Yamamoto
warp/Network/Wai/Handler/Warp/Request.hs+6−6
@@ -70,7 +70,7 @@ headerLines =
70
70
71----------------------------------------------------------------
71----------------------------------------------------------------
72
72
73−parseHeaderLines :: [ByteString] -> IO (ByteString, ByteString, ByteString, H.HttpVersion, [H.Header])
73+parseHeaderLines :: [ByteString] -> IO (ByteString, ByteString, ByteString, H.HttpVersion, H.RequestHeaders)
74parseHeaderLines [] = throwIO $ NotEnoughLines []
74parseHeaderLines [] = throwIO $ NotEnoughLines []
75parseHeaderLines (firstLine:otherLines) = do
75parseHeaderLines (firstLine:otherLines) = do
76 (method, rpath', gets, httpversion) <- parseFirst firstLine
76 (method, rpath', gets, httpversion) <- parseFirst firstLine
@@ -117,9 +117,9 @@ parseRpath rpath'
117
117
118handleExpect :: Connection
118handleExpect :: Connection
119 -> H.HttpVersion
119 -> H.HttpVersion
120− -> ([H.Header] -> [H.Header])
120+ -> (H.RequestHeaders -> H.RequestHeaders)
121− -> [H.Header]
121+ -> H.RequestHeaders
122− -> IO [H.Header]
122+ -> IO H.RequestHeaders
123handleExpect _ _ front [] = return $ front []
123handleExpect _ _ front [] = return $ front []
124handleExpect conn hv front (("expect", "100-continue"):rest) = do
124handleExpect conn hv front (("expect", "100-continue"):rest) = do
125 connSendAll conn $
125 connSendAll conn $
@@ -132,7 +132,7 @@ handleExpect conn hv front (x:xs) = handleExpect conn hv (front . (x:)) xs
132----------------------------------------------------------------
132----------------------------------------------------------------
133
133
134bodyAndSource :: ResumableSource IO ByteString
134bodyAndSource :: ResumableSource IO ByteString
135− -> [H.Header]
135+ -> H.RequestHeaders
136 -> IO (Source IO ByteString
136 -> IO (Source IO ByteString
137 ,RequestBodyLength
137 ,RequestBodyLength
138 ,IO (ResumableSource IO ByteString))
138 ,IO (ResumableSource IO ByteString))
@@ -150,7 +150,7 @@ bodyAndSource src hdr
150 bodyLen = KnownLength $ fromIntegral len0
150 bodyLen = KnownLength $ fromIntegral len0
151 chunked = isChunked hdr
151 chunked = isChunked hdr
152
152
153−isChunked :: [H.Header] -> Bool
153+isChunked :: H.RequestHeaders -> Bool
154isChunked hdr = maybe False ((== "chunked") . CI.foldCase) $ lookup hTransferEncoding hdr
154isChunked hdr = maybe False ((== "chunked") . CI.foldCase) $ lookup hTransferEncoding hdr
155
155
156----------------------------------------------------------------
156----------------------------------------------------------------