implemented stripCRLF

This commit is contained in:
jlamothe committed 2021-11-24 19:44:17 -05:00
1 parent 05e83857a7
commit 391ffd3eea
2 files changed
+26 -5

No files matched your search

+4 -1
View File
@@ -132,7 +132,10 @@ readMax maxLen conn = do
-- | Strips the CR/LF characters from the end of a string, retuning
-- Nothing if they are not present
stripCRLF :: String -> Maybe String
stripCRLF = undefined
stripCRLF = \case
"" -> Nothing
"\r\n" -> Just ""
c:str -> (c:) <$> stripCRLF str
readLoop :: Int -> S.InputStream BS.ByteString -> MaybeT IO Builder
readLoop maxLen src = lift (S.read src) >>= \case