From 9b3cd5c2d8c20aa23725e791d828e07627ce062a Mon Sep 17 00:00:00 2001 From: Anders Kaseorg Date: Sat, 14 Aug 2010 00:19:47 -0400 Subject: [PATCH] Ignore unparsable byte ranges. Signed-off-by: Anders Kaseorg --- StaticCat.hs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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 -- 2.45.0