mirror of
https://github.com/scarf-sh/tie.git
synced 2024-11-25 19:01:32 +03:00
update golden test
This commit is contained in:
parent
5e1e3ab704
commit
efcc04057d
@ -278,13 +278,13 @@ requiredQueryParameter ::
|
||||
requiredQueryParameter name withParam = \request respond ->
|
||||
case List.lookup name (Wai.queryString request) of
|
||||
Nothing ->
|
||||
respond (Wai.responseBuilder (toEnum 400) [] mempty)
|
||||
respond (Wai.responseBuilder (toEnum 400) [] ("Missing query parameter: " <> name))
|
||||
Just Nothing ->
|
||||
respond (Wai.responseBuilder (toEnum 400) [] mempty)
|
||||
respond (Wai.responseBuilder (toEnum 400) [] ("Missing query parameter: " <> name))
|
||||
Just (Just value) ->
|
||||
case parseQueryParam (Text.decodeUtf8 value) of
|
||||
Left _err ->
|
||||
respond (Wai.responseBuilder (toEnum 400) [] mempty)
|
||||
respond (Wai.responseBuilder (toEnum 400) [] ("Unable to recognize query parameter: " <> name))
|
||||
Right x ->
|
||||
withParam x request respond
|
||||
{-# INLINEABLE requiredQueryParameter #-}
|
||||
@ -304,11 +304,11 @@ optionalQueryParameter name allowEmpty withParam = \request respond ->
|
||||
| allowEmpty ->
|
||||
withParam Nothing request respond
|
||||
| otherwise ->
|
||||
respond (Wai.responseBuilder (toEnum 400) [] mempty)
|
||||
respond (Wai.responseBuilder (toEnum 400) [] ("Missing query parameter: " <> name))
|
||||
Just (Just value) ->
|
||||
case parseQueryParam (Text.decodeUtf8 value) of
|
||||
Left _err ->
|
||||
respond (Wai.responseBuilder (toEnum 400) [] mempty)
|
||||
respond (Wai.responseBuilder (toEnum 400) [] ("Unable to recognize query parameter: " <> name))
|
||||
Right x ->
|
||||
withParam (Just x) request respond
|
||||
{-# INLINEABLE optionalQueryParameter #-}
|
||||
|
@ -264,13 +264,13 @@ requiredQueryParameter ::
|
||||
requiredQueryParameter name withParam = \request respond ->
|
||||
case List.lookup name (Wai.queryString request) of
|
||||
Nothing ->
|
||||
respond (Wai.responseBuilder (toEnum 400) [] mempty)
|
||||
respond (Wai.responseBuilder (toEnum 400) [] ("Missing query parameter: " <> name))
|
||||
Just Nothing ->
|
||||
respond (Wai.responseBuilder (toEnum 400) [] mempty)
|
||||
respond (Wai.responseBuilder (toEnum 400) [] ("Missing query parameter: " <> name))
|
||||
Just (Just value) ->
|
||||
case parseQueryParam (Text.decodeUtf8 value) of
|
||||
Left _err ->
|
||||
respond (Wai.responseBuilder (toEnum 400) [] mempty)
|
||||
respond (Wai.responseBuilder (toEnum 400) [] ("Unable to recognize query parameter: " <> name))
|
||||
Right x ->
|
||||
withParam x request respond
|
||||
{-# INLINEABLE requiredQueryParameter #-}
|
||||
@ -290,11 +290,11 @@ optionalQueryParameter name allowEmpty withParam = \request respond ->
|
||||
| allowEmpty ->
|
||||
withParam Nothing request respond
|
||||
| otherwise ->
|
||||
respond (Wai.responseBuilder (toEnum 400) [] mempty)
|
||||
respond (Wai.responseBuilder (toEnum 400) [] ("Missing query parameter: " <> name))
|
||||
Just (Just value) ->
|
||||
case parseQueryParam (Text.decodeUtf8 value) of
|
||||
Left _err ->
|
||||
respond (Wai.responseBuilder (toEnum 400) [] mempty)
|
||||
respond (Wai.responseBuilder (toEnum 400) [] ("Unable to recognize query parameter: " <> name))
|
||||
Right x ->
|
||||
withParam (Just x) request respond
|
||||
{-# INLINEABLE optionalQueryParameter #-}
|
||||
|
@ -264,13 +264,13 @@ requiredQueryParameter ::
|
||||
requiredQueryParameter name withParam = \request respond ->
|
||||
case List.lookup name (Wai.queryString request) of
|
||||
Nothing ->
|
||||
respond (Wai.responseBuilder (toEnum 400) [] mempty)
|
||||
respond (Wai.responseBuilder (toEnum 400) [] ("Missing query parameter: " <> name))
|
||||
Just Nothing ->
|
||||
respond (Wai.responseBuilder (toEnum 400) [] mempty)
|
||||
respond (Wai.responseBuilder (toEnum 400) [] ("Missing query parameter: " <> name))
|
||||
Just (Just value) ->
|
||||
case parseQueryParam (Text.decodeUtf8 value) of
|
||||
Left _err ->
|
||||
respond (Wai.responseBuilder (toEnum 400) [] mempty)
|
||||
respond (Wai.responseBuilder (toEnum 400) [] ("Unable to recognize query parameter: " <> name))
|
||||
Right x ->
|
||||
withParam x request respond
|
||||
{-# INLINEABLE requiredQueryParameter #-}
|
||||
@ -290,11 +290,11 @@ optionalQueryParameter name allowEmpty withParam = \request respond ->
|
||||
| allowEmpty ->
|
||||
withParam Nothing request respond
|
||||
| otherwise ->
|
||||
respond (Wai.responseBuilder (toEnum 400) [] mempty)
|
||||
respond (Wai.responseBuilder (toEnum 400) [] ("Missing query parameter: " <> name))
|
||||
Just (Just value) ->
|
||||
case parseQueryParam (Text.decodeUtf8 value) of
|
||||
Left _err ->
|
||||
respond (Wai.responseBuilder (toEnum 400) [] mempty)
|
||||
respond (Wai.responseBuilder (toEnum 400) [] ("Unable to recognize query parameter: " <> name))
|
||||
Right x ->
|
||||
withParam (Just x) request respond
|
||||
{-# INLINEABLE optionalQueryParameter #-}
|
||||
|
@ -278,13 +278,13 @@ requiredQueryParameter ::
|
||||
requiredQueryParameter name withParam = \request respond ->
|
||||
case List.lookup name (Wai.queryString request) of
|
||||
Nothing ->
|
||||
respond (Wai.responseBuilder (toEnum 400) [] mempty)
|
||||
respond (Wai.responseBuilder (toEnum 400) [] ("Missing query parameter: " <> name))
|
||||
Just Nothing ->
|
||||
respond (Wai.responseBuilder (toEnum 400) [] mempty)
|
||||
respond (Wai.responseBuilder (toEnum 400) [] ("Missing query parameter: " <> name))
|
||||
Just (Just value) ->
|
||||
case parseQueryParam (Text.decodeUtf8 value) of
|
||||
Left _err ->
|
||||
respond (Wai.responseBuilder (toEnum 400) [] mempty)
|
||||
respond (Wai.responseBuilder (toEnum 400) [] ("Unable to recognize query parameter: " <> name))
|
||||
Right x ->
|
||||
withParam x request respond
|
||||
{-# INLINEABLE requiredQueryParameter #-}
|
||||
@ -304,11 +304,11 @@ optionalQueryParameter name allowEmpty withParam = \request respond ->
|
||||
| allowEmpty ->
|
||||
withParam Nothing request respond
|
||||
| otherwise ->
|
||||
respond (Wai.responseBuilder (toEnum 400) [] mempty)
|
||||
respond (Wai.responseBuilder (toEnum 400) [] ("Missing query parameter: " <> name))
|
||||
Just (Just value) ->
|
||||
case parseQueryParam (Text.decodeUtf8 value) of
|
||||
Left _err ->
|
||||
respond (Wai.responseBuilder (toEnum 400) [] mempty)
|
||||
respond (Wai.responseBuilder (toEnum 400) [] ("Unable to recognize query parameter: " <> name))
|
||||
Right x ->
|
||||
withParam (Just x) request respond
|
||||
{-# INLINEABLE optionalQueryParameter #-}
|
||||
|
@ -264,13 +264,13 @@ requiredQueryParameter ::
|
||||
requiredQueryParameter name withParam = \request respond ->
|
||||
case List.lookup name (Wai.queryString request) of
|
||||
Nothing ->
|
||||
respond (Wai.responseBuilder (toEnum 400) [] mempty)
|
||||
respond (Wai.responseBuilder (toEnum 400) [] ("Missing query parameter: " <> name))
|
||||
Just Nothing ->
|
||||
respond (Wai.responseBuilder (toEnum 400) [] mempty)
|
||||
respond (Wai.responseBuilder (toEnum 400) [] ("Missing query parameter: " <> name))
|
||||
Just (Just value) ->
|
||||
case parseQueryParam (Text.decodeUtf8 value) of
|
||||
Left _err ->
|
||||
respond (Wai.responseBuilder (toEnum 400) [] mempty)
|
||||
respond (Wai.responseBuilder (toEnum 400) [] ("Unable to recognize query parameter: " <> name))
|
||||
Right x ->
|
||||
withParam x request respond
|
||||
{-# INLINEABLE requiredQueryParameter #-}
|
||||
@ -290,11 +290,11 @@ optionalQueryParameter name allowEmpty withParam = \request respond ->
|
||||
| allowEmpty ->
|
||||
withParam Nothing request respond
|
||||
| otherwise ->
|
||||
respond (Wai.responseBuilder (toEnum 400) [] mempty)
|
||||
respond (Wai.responseBuilder (toEnum 400) [] ("Missing query parameter: " <> name))
|
||||
Just (Just value) ->
|
||||
case parseQueryParam (Text.decodeUtf8 value) of
|
||||
Left _err ->
|
||||
respond (Wai.responseBuilder (toEnum 400) [] mempty)
|
||||
respond (Wai.responseBuilder (toEnum 400) [] ("Unable to recognize query parameter: " <> name))
|
||||
Right x ->
|
||||
withParam (Just x) request respond
|
||||
{-# INLINEABLE optionalQueryParameter #-}
|
||||
|
@ -267,13 +267,13 @@ requiredQueryParameter ::
|
||||
requiredQueryParameter name withParam = \request respond ->
|
||||
case List.lookup name (Wai.queryString request) of
|
||||
Nothing ->
|
||||
respond (Wai.responseBuilder (toEnum 400) [] mempty)
|
||||
respond (Wai.responseBuilder (toEnum 400) [] ("Missing query parameter: " <> name))
|
||||
Just Nothing ->
|
||||
respond (Wai.responseBuilder (toEnum 400) [] mempty)
|
||||
respond (Wai.responseBuilder (toEnum 400) [] ("Missing query parameter: " <> name))
|
||||
Just (Just value) ->
|
||||
case parseQueryParam (Text.decodeUtf8 value) of
|
||||
Left _err ->
|
||||
respond (Wai.responseBuilder (toEnum 400) [] mempty)
|
||||
respond (Wai.responseBuilder (toEnum 400) [] ("Unable to recognize query parameter: " <> name))
|
||||
Right x ->
|
||||
withParam x request respond
|
||||
{-# INLINEABLE requiredQueryParameter #-}
|
||||
@ -293,11 +293,11 @@ optionalQueryParameter name allowEmpty withParam = \request respond ->
|
||||
| allowEmpty ->
|
||||
withParam Nothing request respond
|
||||
| otherwise ->
|
||||
respond (Wai.responseBuilder (toEnum 400) [] mempty)
|
||||
respond (Wai.responseBuilder (toEnum 400) [] ("Missing query parameter: " <> name))
|
||||
Just (Just value) ->
|
||||
case parseQueryParam (Text.decodeUtf8 value) of
|
||||
Left _err ->
|
||||
respond (Wai.responseBuilder (toEnum 400) [] mempty)
|
||||
respond (Wai.responseBuilder (toEnum 400) [] ("Unable to recognize query parameter: " <> name))
|
||||
Right x ->
|
||||
withParam (Just x) request respond
|
||||
{-# INLINEABLE optionalQueryParameter #-}
|
||||
|
@ -331,13 +331,13 @@ requiredQueryParameter ::
|
||||
requiredQueryParameter name withParam = \request respond ->
|
||||
case List.lookup name (Wai.queryString request) of
|
||||
Nothing ->
|
||||
respond (Wai.responseBuilder (toEnum 400) [] mempty)
|
||||
respond (Wai.responseBuilder (toEnum 400) [] ("Missing query parameter: " <> name))
|
||||
Just Nothing ->
|
||||
respond (Wai.responseBuilder (toEnum 400) [] mempty)
|
||||
respond (Wai.responseBuilder (toEnum 400) [] ("Missing query parameter: " <> name))
|
||||
Just (Just value) ->
|
||||
case parseQueryParam (Text.decodeUtf8 value) of
|
||||
Left _err ->
|
||||
respond (Wai.responseBuilder (toEnum 400) [] mempty)
|
||||
respond (Wai.responseBuilder (toEnum 400) [] ("Unable to recognize query parameter: " <> name))
|
||||
Right x ->
|
||||
withParam x request respond
|
||||
{-# INLINEABLE requiredQueryParameter #-}
|
||||
@ -357,11 +357,11 @@ optionalQueryParameter name allowEmpty withParam = \request respond ->
|
||||
| allowEmpty ->
|
||||
withParam Nothing request respond
|
||||
| otherwise ->
|
||||
respond (Wai.responseBuilder (toEnum 400) [] mempty)
|
||||
respond (Wai.responseBuilder (toEnum 400) [] ("Missing query parameter: " <> name))
|
||||
Just (Just value) ->
|
||||
case parseQueryParam (Text.decodeUtf8 value) of
|
||||
Left _err ->
|
||||
respond (Wai.responseBuilder (toEnum 400) [] mempty)
|
||||
respond (Wai.responseBuilder (toEnum 400) [] ("Unable to recognize query parameter: " <> name))
|
||||
Right x ->
|
||||
withParam (Just x) request respond
|
||||
{-# INLINEABLE optionalQueryParameter #-}
|
||||
|
@ -282,13 +282,13 @@ requiredQueryParameter ::
|
||||
requiredQueryParameter name withParam = \request respond ->
|
||||
case List.lookup name (Wai.queryString request) of
|
||||
Nothing ->
|
||||
respond (Wai.responseBuilder (toEnum 400) [] mempty)
|
||||
respond (Wai.responseBuilder (toEnum 400) [] ("Missing query parameter: " <> name))
|
||||
Just Nothing ->
|
||||
respond (Wai.responseBuilder (toEnum 400) [] mempty)
|
||||
respond (Wai.responseBuilder (toEnum 400) [] ("Missing query parameter: " <> name))
|
||||
Just (Just value) ->
|
||||
case parseQueryParam (Text.decodeUtf8 value) of
|
||||
Left _err ->
|
||||
respond (Wai.responseBuilder (toEnum 400) [] mempty)
|
||||
respond (Wai.responseBuilder (toEnum 400) [] ("Unable to recognize query parameter: " <> name))
|
||||
Right x ->
|
||||
withParam x request respond
|
||||
{-# INLINEABLE requiredQueryParameter #-}
|
||||
@ -308,11 +308,11 @@ optionalQueryParameter name allowEmpty withParam = \request respond ->
|
||||
| allowEmpty ->
|
||||
withParam Nothing request respond
|
||||
| otherwise ->
|
||||
respond (Wai.responseBuilder (toEnum 400) [] mempty)
|
||||
respond (Wai.responseBuilder (toEnum 400) [] ("Missing query parameter: " <> name))
|
||||
Just (Just value) ->
|
||||
case parseQueryParam (Text.decodeUtf8 value) of
|
||||
Left _err ->
|
||||
respond (Wai.responseBuilder (toEnum 400) [] mempty)
|
||||
respond (Wai.responseBuilder (toEnum 400) [] ("Unable to recognize query parameter: " <> name))
|
||||
Right x ->
|
||||
withParam (Just x) request respond
|
||||
{-# INLINEABLE optionalQueryParameter #-}
|
||||
|
@ -295,13 +295,13 @@ requiredQueryParameter ::
|
||||
requiredQueryParameter name withParam = \request respond ->
|
||||
case List.lookup name (Wai.queryString request) of
|
||||
Nothing ->
|
||||
respond (Wai.responseBuilder (toEnum 400) [] mempty)
|
||||
respond (Wai.responseBuilder (toEnum 400) [] ("Missing query parameter: " <> name))
|
||||
Just Nothing ->
|
||||
respond (Wai.responseBuilder (toEnum 400) [] mempty)
|
||||
respond (Wai.responseBuilder (toEnum 400) [] ("Missing query parameter: " <> name))
|
||||
Just (Just value) ->
|
||||
case parseQueryParam (Text.decodeUtf8 value) of
|
||||
Left _err ->
|
||||
respond (Wai.responseBuilder (toEnum 400) [] mempty)
|
||||
respond (Wai.responseBuilder (toEnum 400) [] ("Unable to recognize query parameter: " <> name))
|
||||
Right x ->
|
||||
withParam x request respond
|
||||
{-# INLINEABLE requiredQueryParameter #-}
|
||||
@ -321,11 +321,11 @@ optionalQueryParameter name allowEmpty withParam = \request respond ->
|
||||
| allowEmpty ->
|
||||
withParam Nothing request respond
|
||||
| otherwise ->
|
||||
respond (Wai.responseBuilder (toEnum 400) [] mempty)
|
||||
respond (Wai.responseBuilder (toEnum 400) [] ("Missing query parameter: " <> name))
|
||||
Just (Just value) ->
|
||||
case parseQueryParam (Text.decodeUtf8 value) of
|
||||
Left _err ->
|
||||
respond (Wai.responseBuilder (toEnum 400) [] mempty)
|
||||
respond (Wai.responseBuilder (toEnum 400) [] ("Unable to recognize query parameter: " <> name))
|
||||
Right x ->
|
||||
withParam (Just x) request respond
|
||||
{-# INLINEABLE optionalQueryParameter #-}
|
||||
|
@ -328,13 +328,13 @@ requiredQueryParameter ::
|
||||
requiredQueryParameter name withParam = \request respond ->
|
||||
case List.lookup name (Wai.queryString request) of
|
||||
Nothing ->
|
||||
respond (Wai.responseBuilder (toEnum 400) [] mempty)
|
||||
respond (Wai.responseBuilder (toEnum 400) [] ("Missing query parameter: " <> name))
|
||||
Just Nothing ->
|
||||
respond (Wai.responseBuilder (toEnum 400) [] mempty)
|
||||
respond (Wai.responseBuilder (toEnum 400) [] ("Missing query parameter: " <> name))
|
||||
Just (Just value) ->
|
||||
case parseQueryParam (Text.decodeUtf8 value) of
|
||||
Left _err ->
|
||||
respond (Wai.responseBuilder (toEnum 400) [] mempty)
|
||||
respond (Wai.responseBuilder (toEnum 400) [] ("Unable to recognize query parameter: " <> name))
|
||||
Right x ->
|
||||
withParam x request respond
|
||||
{-# INLINEABLE requiredQueryParameter #-}
|
||||
@ -354,11 +354,11 @@ optionalQueryParameter name allowEmpty withParam = \request respond ->
|
||||
| allowEmpty ->
|
||||
withParam Nothing request respond
|
||||
| otherwise ->
|
||||
respond (Wai.responseBuilder (toEnum 400) [] mempty)
|
||||
respond (Wai.responseBuilder (toEnum 400) [] ("Missing query parameter: " <> name))
|
||||
Just (Just value) ->
|
||||
case parseQueryParam (Text.decodeUtf8 value) of
|
||||
Left _err ->
|
||||
respond (Wai.responseBuilder (toEnum 400) [] mempty)
|
||||
respond (Wai.responseBuilder (toEnum 400) [] ("Unable to recognize query parameter: " <> name))
|
||||
Right x ->
|
||||
withParam (Just x) request respond
|
||||
{-# INLINEABLE optionalQueryParameter #-}
|
||||
|
@ -264,13 +264,13 @@ requiredQueryParameter ::
|
||||
requiredQueryParameter name withParam = \request respond ->
|
||||
case List.lookup name (Wai.queryString request) of
|
||||
Nothing ->
|
||||
respond (Wai.responseBuilder (toEnum 400) [] mempty)
|
||||
respond (Wai.responseBuilder (toEnum 400) [] ("Missing query parameter: " <> name))
|
||||
Just Nothing ->
|
||||
respond (Wai.responseBuilder (toEnum 400) [] mempty)
|
||||
respond (Wai.responseBuilder (toEnum 400) [] ("Missing query parameter: " <> name))
|
||||
Just (Just value) ->
|
||||
case parseQueryParam (Text.decodeUtf8 value) of
|
||||
Left _err ->
|
||||
respond (Wai.responseBuilder (toEnum 400) [] mempty)
|
||||
respond (Wai.responseBuilder (toEnum 400) [] ("Unable to recognize query parameter: " <> name))
|
||||
Right x ->
|
||||
withParam x request respond
|
||||
{-# INLINEABLE requiredQueryParameter #-}
|
||||
@ -290,11 +290,11 @@ optionalQueryParameter name allowEmpty withParam = \request respond ->
|
||||
| allowEmpty ->
|
||||
withParam Nothing request respond
|
||||
| otherwise ->
|
||||
respond (Wai.responseBuilder (toEnum 400) [] mempty)
|
||||
respond (Wai.responseBuilder (toEnum 400) [] ("Missing query parameter: " <> name))
|
||||
Just (Just value) ->
|
||||
case parseQueryParam (Text.decodeUtf8 value) of
|
||||
Left _err ->
|
||||
respond (Wai.responseBuilder (toEnum 400) [] mempty)
|
||||
respond (Wai.responseBuilder (toEnum 400) [] ("Unable to recognize query parameter: " <> name))
|
||||
Right x ->
|
||||
withParam (Just x) request respond
|
||||
{-# INLINEABLE optionalQueryParameter #-}
|
||||
|
@ -264,13 +264,13 @@ requiredQueryParameter ::
|
||||
requiredQueryParameter name withParam = \request respond ->
|
||||
case List.lookup name (Wai.queryString request) of
|
||||
Nothing ->
|
||||
respond (Wai.responseBuilder (toEnum 400) [] mempty)
|
||||
respond (Wai.responseBuilder (toEnum 400) [] ("Missing query parameter: " <> name))
|
||||
Just Nothing ->
|
||||
respond (Wai.responseBuilder (toEnum 400) [] mempty)
|
||||
respond (Wai.responseBuilder (toEnum 400) [] ("Missing query parameter: " <> name))
|
||||
Just (Just value) ->
|
||||
case parseQueryParam (Text.decodeUtf8 value) of
|
||||
Left _err ->
|
||||
respond (Wai.responseBuilder (toEnum 400) [] mempty)
|
||||
respond (Wai.responseBuilder (toEnum 400) [] ("Unable to recognize query parameter: " <> name))
|
||||
Right x ->
|
||||
withParam x request respond
|
||||
{-# INLINEABLE requiredQueryParameter #-}
|
||||
@ -290,11 +290,11 @@ optionalQueryParameter name allowEmpty withParam = \request respond ->
|
||||
| allowEmpty ->
|
||||
withParam Nothing request respond
|
||||
| otherwise ->
|
||||
respond (Wai.responseBuilder (toEnum 400) [] mempty)
|
||||
respond (Wai.responseBuilder (toEnum 400) [] ("Missing query parameter: " <> name))
|
||||
Just (Just value) ->
|
||||
case parseQueryParam (Text.decodeUtf8 value) of
|
||||
Left _err ->
|
||||
respond (Wai.responseBuilder (toEnum 400) [] mempty)
|
||||
respond (Wai.responseBuilder (toEnum 400) [] ("Unable to recognize query parameter: " <> name))
|
||||
Right x ->
|
||||
withParam (Just x) request respond
|
||||
{-# INLINEABLE optionalQueryParameter #-}
|
||||
|
@ -294,13 +294,13 @@ requiredQueryParameter ::
|
||||
requiredQueryParameter name withParam = \request respond ->
|
||||
case List.lookup name (Wai.queryString request) of
|
||||
Nothing ->
|
||||
respond (Wai.responseBuilder (toEnum 400) [] mempty)
|
||||
respond (Wai.responseBuilder (toEnum 400) [] ("Missing query parameter: " <> name))
|
||||
Just Nothing ->
|
||||
respond (Wai.responseBuilder (toEnum 400) [] mempty)
|
||||
respond (Wai.responseBuilder (toEnum 400) [] ("Missing query parameter: " <> name))
|
||||
Just (Just value) ->
|
||||
case parseQueryParam (Text.decodeUtf8 value) of
|
||||
Left _err ->
|
||||
respond (Wai.responseBuilder (toEnum 400) [] mempty)
|
||||
respond (Wai.responseBuilder (toEnum 400) [] ("Unable to recognize query parameter: " <> name))
|
||||
Right x ->
|
||||
withParam x request respond
|
||||
{-# INLINEABLE requiredQueryParameter #-}
|
||||
@ -320,11 +320,11 @@ optionalQueryParameter name allowEmpty withParam = \request respond ->
|
||||
| allowEmpty ->
|
||||
withParam Nothing request respond
|
||||
| otherwise ->
|
||||
respond (Wai.responseBuilder (toEnum 400) [] mempty)
|
||||
respond (Wai.responseBuilder (toEnum 400) [] ("Missing query parameter: " <> name))
|
||||
Just (Just value) ->
|
||||
case parseQueryParam (Text.decodeUtf8 value) of
|
||||
Left _err ->
|
||||
respond (Wai.responseBuilder (toEnum 400) [] mempty)
|
||||
respond (Wai.responseBuilder (toEnum 400) [] ("Unable to recognize query parameter: " <> name))
|
||||
Right x ->
|
||||
withParam (Just x) request respond
|
||||
{-# INLINEABLE optionalQueryParameter #-}
|
||||
|
@ -295,13 +295,13 @@ requiredQueryParameter ::
|
||||
requiredQueryParameter name withParam = \request respond ->
|
||||
case List.lookup name (Wai.queryString request) of
|
||||
Nothing ->
|
||||
respond (Wai.responseBuilder (toEnum 400) [] mempty)
|
||||
respond (Wai.responseBuilder (toEnum 400) [] ("Missing query parameter: " <> name))
|
||||
Just Nothing ->
|
||||
respond (Wai.responseBuilder (toEnum 400) [] mempty)
|
||||
respond (Wai.responseBuilder (toEnum 400) [] ("Missing query parameter: " <> name))
|
||||
Just (Just value) ->
|
||||
case parseQueryParam (Text.decodeUtf8 value) of
|
||||
Left _err ->
|
||||
respond (Wai.responseBuilder (toEnum 400) [] mempty)
|
||||
respond (Wai.responseBuilder (toEnum 400) [] ("Unable to recognize query parameter: " <> name))
|
||||
Right x ->
|
||||
withParam x request respond
|
||||
{-# INLINEABLE requiredQueryParameter #-}
|
||||
@ -321,11 +321,11 @@ optionalQueryParameter name allowEmpty withParam = \request respond ->
|
||||
| allowEmpty ->
|
||||
withParam Nothing request respond
|
||||
| otherwise ->
|
||||
respond (Wai.responseBuilder (toEnum 400) [] mempty)
|
||||
respond (Wai.responseBuilder (toEnum 400) [] ("Missing query parameter: " <> name))
|
||||
Just (Just value) ->
|
||||
case parseQueryParam (Text.decodeUtf8 value) of
|
||||
Left _err ->
|
||||
respond (Wai.responseBuilder (toEnum 400) [] mempty)
|
||||
respond (Wai.responseBuilder (toEnum 400) [] ("Unable to recognize query parameter: " <> name))
|
||||
Right x ->
|
||||
withParam (Just x) request respond
|
||||
{-# INLINEABLE optionalQueryParameter #-}
|
||||
|
@ -298,13 +298,13 @@ requiredQueryParameter ::
|
||||
requiredQueryParameter name withParam = \request respond ->
|
||||
case List.lookup name (Wai.queryString request) of
|
||||
Nothing ->
|
||||
respond (Wai.responseBuilder (toEnum 400) [] mempty)
|
||||
respond (Wai.responseBuilder (toEnum 400) [] ("Missing query parameter: " <> name))
|
||||
Just Nothing ->
|
||||
respond (Wai.responseBuilder (toEnum 400) [] mempty)
|
||||
respond (Wai.responseBuilder (toEnum 400) [] ("Missing query parameter: " <> name))
|
||||
Just (Just value) ->
|
||||
case parseQueryParam (Text.decodeUtf8 value) of
|
||||
Left _err ->
|
||||
respond (Wai.responseBuilder (toEnum 400) [] mempty)
|
||||
respond (Wai.responseBuilder (toEnum 400) [] ("Unable to recognize query parameter: " <> name))
|
||||
Right x ->
|
||||
withParam x request respond
|
||||
{-# INLINEABLE requiredQueryParameter #-}
|
||||
@ -324,11 +324,11 @@ optionalQueryParameter name allowEmpty withParam = \request respond ->
|
||||
| allowEmpty ->
|
||||
withParam Nothing request respond
|
||||
| otherwise ->
|
||||
respond (Wai.responseBuilder (toEnum 400) [] mempty)
|
||||
respond (Wai.responseBuilder (toEnum 400) [] ("Missing query parameter: " <> name))
|
||||
Just (Just value) ->
|
||||
case parseQueryParam (Text.decodeUtf8 value) of
|
||||
Left _err ->
|
||||
respond (Wai.responseBuilder (toEnum 400) [] mempty)
|
||||
respond (Wai.responseBuilder (toEnum 400) [] ("Unable to recognize query parameter: " <> name))
|
||||
Right x ->
|
||||
withParam (Just x) request respond
|
||||
{-# INLINEABLE optionalQueryParameter #-}
|
||||
|
Loading…
Reference in New Issue
Block a user