From: Anders Kaseorg Date: Sat, 14 Aug 2010 04:19:47 +0000 (-0400) Subject: Ignore unparsable byte ranges. X-Git-Url: http://andersk.mit.edu/gitweb/scripts-static-cat.git/commitdiff_plain/9b3cd5c2d8c20aa23725e791d828e07627ce062a Ignore unparsable byte ranges. Signed-off-by: Anders Kaseorg --- diff --git a/StaticCat.hs b/StaticCat.hs index df4a6e2..ba9e0b7 100644 --- a/StaticCat.hs +++ b/StaticCat.hs @@ -140,7 +140,8 @@ checkRange mTime size = do (checkIfRange mTime >>=) $ maybe (return Nothing) $ \() -> do case parseRange range size of Just (a, b) | a <= b -> return $ Just (a, b) - _ -> throw BadRange + Just _ -> throw BadRange + Nothing -> return Nothing outputAll :: Handle -> FileOffset -> CGI CGIResult outputAll h size = do