mirror of
https://github.com/Start9Labs/registry.git
synced 2026-03-26 10:21:51 +00:00
hash on upload (#123)
* hash on upload * Update src/Cli/Cli.hs * fix import and clean up error response * remove content length limit * remove import * lift version * slow af but works Co-authored-by: Lucy C <12953208+elvece@users.noreply.github.com>
This commit is contained in:
@@ -97,6 +97,17 @@ getVersionSpecFromQuery = do
|
||||
Nothing -> sendResponseStatus status400 ("Invalid App Version Specification" :: Text)
|
||||
Just t -> pure t
|
||||
|
||||
getVersionFromQuery :: MonadHandler m => m (Maybe Version)
|
||||
getVersionFromQuery = do
|
||||
versionString <- lookupGetParam "version"
|
||||
case versionString of
|
||||
Nothing -> pure Nothing
|
||||
Just v -> case readMaybe v of
|
||||
Nothing -> sendResponseStatus status400 ("Invalid Version" :: Text)
|
||||
Just t -> pure (Just t)
|
||||
|
||||
getHashFromQuery :: MonadHandler m => m (Maybe Text)
|
||||
getHashFromQuery = lookupGetParam "hash"
|
||||
|
||||
versionPriorityFromQueryIsMin :: MonadHandler m => m Bool
|
||||
versionPriorityFromQueryIsMin = do
|
||||
|
||||
Reference in New Issue
Block a user