changes unfindable versions to 404's

This commit is contained in:
Keagan McClelland
2019-12-27 23:25:55 -07:00
parent bbb6eb2fab
commit 87bb534ebf

View File

@@ -60,11 +60,11 @@ getApp rootDir appId = do
let appVersions = registeredAppVersions appId reg let appVersions = registeredAppVersions appId reg
putStrLn $ "valid appversion for " <> appId <> ": " <> show (fmap version appVersions) putStrLn $ "valid appversion for " <> appId <> ": " <> show (fmap version appVersions)
case getSpecifiedAppVersion spec appVersions of case getSpecifiedAppVersion spec appVersions of
Nothing -> respondSource typePlain sendFlush Nothing -> notFound
Just (RegisteredAppVersion (_, filePath)) -> do Just (RegisteredAppVersion (_, filePath)) -> do
exists <- liftIO $ doesFileExist filePath exists <- liftIO $ doesFileExist filePath
if exists if exists
then respondSource typePlain $ CB.sourceFile filePath .| awaitForever sendChunkBS then respondSource typePlain $ CB.sourceFile filePath .| awaitForever sendChunkBS
else respondSource typePlain sendFlush else notFound