git.iko.soy/typeable/attoparsec
on master help sign in
Be stricter about HTTP protocol version parsing.
commitd8d41e91c96d96872eedbefd884ddc1d952e4f7d authorBryan O'Sullivan <bos@serpentine.com> dateSat 27 Feb 2010, 13:02 (17 years ago) parentdd806f3
1 file changed+2−2
examples/RFC2616.hs+2−2
examples/RFC2616.hs+2−2
@@ -32,10 +32,10 @@ requestLine :: Parser Request
3232requestLine = do
3333 method <- P.takeWhile1 isToken <* skipHSpaces
3434 uri <- P.takeWhile1 (not . isHorizontalSpace) <* skipHSpaces <* string "HTTP/"
35− proto <- P.takeWhile1 isDigitOrDot <* endOfLine
35+ proto <- P.takeWhile1 isHttpVersion <* endOfLine
3636 return $! Request method uri proto
3737 where
38− isDigitOrDot w = (w >= 48 && w <= 57) || w == 46
38+ isHttpVersion w = w == 46 || w == 48 || w == 49
3939
4040data Header = Header {
4141 headerName :: !B.ByteString