on master help sign in
proper name.
commit0745a49ea5340b45a6c62f165c014db10dc32beb authorKazu Yamamoto <kazu@iij.ad.jp> dateFri 1 Nov 2013, 10:30 (13 years ago) parent664fc90
2 files changed+15−9
warp/Network/Wai/Handler/Warp/Request.hs+5−5 warp/Network/Wai/Handler/Warp/RequestHeader.hs+10−4
warp/Network/Wai/Handler/Warp/Request.hs+5−5
@@ -54,7 +54,7 @@ recvRequest :: Connection
5454
5555recvRequest conn ii addr src0 = do
5656 (src, hdrlines) <- src0 $$+ headerLines
57− (method, rpath, gets, httpversion, hdr) <- parseHeaderLines hdrlines
57+ (method, path, query, httpversion, hdr) <- parseHeaderLines hdrlines
5858 let idxhdr = indexRequestHeader hdr
5959 expect = idxhdr ! idxExpect
6060 cl = idxhdr ! idxContentLength
@@ -64,10 +64,10 @@ recvRequest conn ii addr src0 = do
6464 let req = Request {
6565 requestMethod = method
6666 , httpVersion = httpversion
67− , pathInfo = H.decodePathSegments rpath
68− , rawPathInfo = rpath
69− , rawQueryString = gets
70− , queryString = H.parseQuery gets
67+ , pathInfo = H.decodePathSegments path
68+ , rawPathInfo = path
69+ , rawQueryString = query
70+ , queryString = H.parseQuery query
7171 , requestHeaders = hdr
7272 , isSecure = False
7373 , remoteHost = addr
warp/Network/Wai/Handler/Warp/RequestHeader.hs+10−4
@@ -13,13 +13,19 @@ import Prelude hiding (lines)
1313
1414----------------------------------------------------------------
1515
16−parseHeaderLines :: [ByteString] -> IO (ByteString, ByteString, ByteString, H.HttpVersion, H.RequestHeaders)
16+parseHeaderLines :: [ByteString]
17+ -> IO (H.Method
18+ ,ByteString -- Path
19+ ,ByteString -- Query
20+ ,H.HttpVersion
21+ ,H.RequestHeaders
22+ )
1723parseHeaderLines [] = throwIO $ NotEnoughLines []
1824parseHeaderLines (firstLine:otherLines) = do
19− (method, rpath', gets, httpversion) <- parseFirst firstLine
20− let rpath = parseRpath rpath'
25+ (method, path', query, httpversion) <- parseFirst firstLine
26+ let path = parseRpath path'
2127 hdr = map parseHeaderNoAttr otherLines
22− return (method, rpath, gets, httpversion, hdr)
28+ return (method, path, query, httpversion, hdr)
2329
2430----------------------------------------------------------------
2531