fix: Return 406 instead of 415 for non-acceptable media type

415 is for Content-Type and 406 for Accept headers.
This commit is contained in:
Wolfgang Walther
2024-02-15 19:01:12 +01:00
parent 3432f75ed4
commit 2466f4e738
8 changed files with 19 additions and 18 deletions
+2 -2
View File
@@ -939,12 +939,12 @@ spec actualPgVersion = do
}
describe "Accept headers" $ do
it "should respond an unknown accept type with 415" $
it "should respond an unknown accept type with 406" $
request methodGet "/simple_pk"
(acceptHdrs "text/unknowntype") ""
`shouldRespondWith`
[json|{"message":"None of these media types are available: text/unknowntype","code":"PGRST107","details":null,"hint":null}|]
{ matchStatus = 415
{ matchStatus = 406
, matchHeaders = [matchContentTypeJson]
}