on master help sign in
proper name.
0745a49Kazu Yamamoto
warp/Network/Wai/Handler/Warp/Request.hs+5−5
@@ -54,7 +54,7 @@ recvRequest :: Connection
54
54
55recvRequest conn ii addr src0 = do
55recvRequest conn ii addr src0 = do
56 (src, hdrlines) <- src0 $$+ headerLines
56 (src, hdrlines) <- src0 $$+ headerLines
57− (method, rpath, gets, httpversion, hdr) <- parseHeaderLines hdrlines
57+ (method, path, query, httpversion, hdr) <- parseHeaderLines hdrlines
58 let idxhdr = indexRequestHeader hdr
58 let idxhdr = indexRequestHeader hdr
59 expect = idxhdr ! idxExpect
59 expect = idxhdr ! idxExpect
60 cl = idxhdr ! idxContentLength
60 cl = idxhdr ! idxContentLength
@@ -64,10 +64,10 @@ recvRequest conn ii addr src0 = do
64 let req = Request {
64 let req = Request {
65 requestMethod = method
65 requestMethod = method
66 , httpVersion = httpversion
66 , httpVersion = httpversion
67− , pathInfo = H.decodePathSegments rpath
67+ , pathInfo = H.decodePathSegments path
68− , rawPathInfo = rpath
68+ , rawPathInfo = path
69− , rawQueryString = gets
69+ , rawQueryString = query
70− , queryString = H.parseQuery gets
70+ , queryString = H.parseQuery query
71 , requestHeaders = hdr
71 , requestHeaders = hdr
72 , isSecure = False
72 , isSecure = False
73 , remoteHost = addr
73 , remoteHost = addr
warp/Network/Wai/Handler/Warp/RequestHeader.hs+10−4
@@ -13,13 +13,19 @@ import Prelude hiding (lines)
13
13
14----------------------------------------------------------------
14----------------------------------------------------------------
15
15
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+ )
17parseHeaderLines [] = throwIO $ NotEnoughLines []
23parseHeaderLines [] = throwIO $ NotEnoughLines []
18parseHeaderLines (firstLine:otherLines) = do
24parseHeaderLines (firstLine:otherLines) = do
19− (method, rpath', gets, httpversion) <- parseFirst firstLine
25+ (method, path', query, httpversion) <- parseFirst firstLine
20− let rpath = parseRpath rpath'
26+ let path = parseRpath path'
21 hdr = map parseHeaderNoAttr otherLines
27 hdr = map parseHeaderNoAttr otherLines
22− return (method, rpath, gets, httpversion, hdr)
28+ return (method, path, query, httpversion, hdr)
23
29
24----------------------------------------------------------------
30----------------------------------------------------------------
25
31