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:
committed by
Wolfgang Walther
parent
e4984dc751
commit
491c7a0891
@@ -656,10 +656,10 @@ spec actualPgVersion =
|
||||
it "rejects unknown content type even if payload is good" $ do
|
||||
request methodPost "/rpc/sayhello"
|
||||
(acceptHdrs "audio/mpeg3") [json| { "name": "world" } |]
|
||||
`shouldRespondWith` 415
|
||||
`shouldRespondWith` 406
|
||||
request methodGet "/rpc/sayhello?name=world"
|
||||
(acceptHdrs "audio/mpeg3") ""
|
||||
`shouldRespondWith` 415
|
||||
`shouldRespondWith` 406
|
||||
it "rejects malformed json payload" $ do
|
||||
p <- request methodPost "/rpc/sayhello"
|
||||
(acceptHdrs "application/json") "sdfsdf"
|
||||
|
||||
Reference in New Issue
Block a user