fix: no empty tx on bad HTTP method
This commit is contained in:
committed by
Steve Chavez
parent
6d7bf9faa9
commit
8230128ff6
@@ -35,7 +35,7 @@ spec = do
|
||||
{"hint": null,
|
||||
"details": null,
|
||||
"code": "PGRST117",
|
||||
"message":"Unsupported HTTP verb: CONNECT"}|]
|
||||
"message":"Unsupported HTTP method: CONNECT"}|]
|
||||
{ matchStatus = 405 }
|
||||
|
||||
it "should return 405 for TRACE method" $
|
||||
@@ -47,7 +47,7 @@ spec = do
|
||||
{"hint": null,
|
||||
"details": null,
|
||||
"code": "PGRST117",
|
||||
"message":"Unsupported HTTP verb: TRACE"}|]
|
||||
"message":"Unsupported HTTP method: TRACE"}|]
|
||||
{ matchStatus = 405 }
|
||||
|
||||
it "should return 405 for OTHER method" $
|
||||
@@ -59,5 +59,5 @@ spec = do
|
||||
{"hint": null,
|
||||
"details": null,
|
||||
"code": "PGRST117",
|
||||
"message":"Unsupported HTTP verb: OTHER"}|]
|
||||
"message":"Unsupported HTTP method: OTHER"}|]
|
||||
{ matchStatus = 405 }
|
||||
|
||||
@@ -516,11 +516,11 @@ spec actualPgVersion =
|
||||
simpleStatus p `shouldBe` internalServerError500
|
||||
isErrorFormat (simpleBody p) `shouldBe` True
|
||||
|
||||
context "unsupported verbs" $ do
|
||||
context "unsupported method" $ do
|
||||
it "DELETE fails" $
|
||||
request methodDelete "/rpc/sayhello" [] ""
|
||||
`shouldRespondWith`
|
||||
[json|{"message":"Bad Request","code":"PGRST101","details":null,"hint":null}|]
|
||||
[json|{"message":"Cannot use the DELETE method on RPC","code":"PGRST101","details":null,"hint":null}|]
|
||||
{ matchStatus = 405
|
||||
, matchHeaders = [matchContentTypeJson]
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user