fix: Return 204 No Content without Content-Type for RPCs returning VOID

Resolves #2001

BREAKING CHANGE: Previously, those RPCs would return "null" as a body with Content-Type: application/json.
This commit is contained in:
Wolfgang Walther
2022-02-05 09:28:28 +01:00
committed by Wolfgang Walther
parent 9ca9a54d21
commit 52d628f1ed
7 changed files with 66 additions and 33 deletions
+12 -3
View File
@@ -179,7 +179,10 @@ spec actualPgVersion = do
[("Prefer", "tx=commit")]
[json|{"name": "auto_incrementing_pk_id_seq", "value": 2}|]
`shouldRespondWith`
[json|""|]
""
{ matchStatus = 204
, matchHeaders = [ matchHeaderAbsent hContentType ]
}
request methodPost "/auto_incrementing_pk"
[("Prefer", "return=headers-only")]
@@ -357,7 +360,10 @@ spec actualPgVersion = do
[("Prefer", "tx=commit")]
[json|{"name": "items2_id_seq", "value": 20}|]
`shouldRespondWith`
[json|""|]
""
{ matchStatus = 204
, matchHeaders = [ matchHeaderAbsent hContentType ]
}
request methodPost "/items2"
[("Prefer", "return=representation")]
@@ -372,7 +378,10 @@ spec actualPgVersion = do
[("Prefer", "tx=commit")]
[json|{"name": "items3_id_seq", "value": 20}|]
`shouldRespondWith`
[json|""|]
""
{ matchStatus = 204
, matchHeaders = [ matchHeaderAbsent hContentType ]
}
request methodPost "/items3?select=id"
[("Prefer", "return=representation")]