fix: Return 204 No Content without Content-Type for PUT

This commit is contained in:
Wolfgang Walther
2021-12-01 09:19:47 +01:00
committed by Wolfgang Walther
parent 1cb00d3c62
commit 0e20b47875
15 changed files with 373 additions and 193 deletions
+7 -2
View File
@@ -22,8 +22,13 @@ spec :: PgVersion -> SpecWith ((), Application)
spec actualPgVersion = describe "OpenAPI" $ do
it "root path returns a valid openapi spec" $ do
validateOpenApiResponse [("Accept", "application/openapi+json")]
request methodHead "/" (acceptHdrs "application/openapi+json") ""
`shouldRespondWith` "" { matchStatus = 200 }
request methodHead "/"
(acceptHdrs "application/openapi+json") ""
`shouldRespondWith`
""
{ matchStatus = 200
, matchHeaders = ["Content-Type" <:> "application/openapi+json; charset=utf-8"]
}
it "should respond to openapi request on none root path with 415" $
request methodGet "/items"