Do not quote params in Location header

Also treat the enum field in OPTIONS as an array uniformly
This commit is contained in:
Joe Nelson
2014-12-06 17:42:21 -08:00
parent 42faaa97c9
commit f1ecbec543
6 changed files with 44 additions and 42 deletions
+7 -1
View File
@@ -116,7 +116,7 @@ app req =
then inserted
else filterWithKey (const . (`elem` primaryKeys)) inserted
let params = urlEncodeVars
$ map (\t -> (cs $ fst t, "eq." <> cs (encode $ snd t)))
$ map (\t -> (cs $ fst t, "eq." <> cs (unquoted $ snd t)))
$ sortBy (comparing fst) $ toList primaries
return $ responseLBS status201
[ jsonH
@@ -224,6 +224,12 @@ handleJsonObj req handler = do
jErr = encode . object $
[("error", String "Expecting a JSON object")]
unquoted :: Value -> Text
unquoted (String t) = t
unquoted (Number n) = cs . show $ n
unquoted (Bool b) = cs . show $ b
unquoted _ = ""
data TableOptions = TableOptions {
tblOptcolumns :: [Column]
, tblOptpkey :: [Text]