fix: Using GET with certain Content-Type headers now correctly calls the no parameter function if it exists

Using GET with text/plain or application/octet-stream as Content-Type headers no longer returns 404 Not Found when a function with no parameters exists
This commit is contained in:
Laurence Isla
2022-02-28 13:23:55 -05:00
committed by GitHub
parent 69070f341a
commit 99d0b805df
3 changed files with 13 additions and 1 deletions
+1 -1
View File
@@ -465,7 +465,7 @@ findProc qi argumentsKeys paramsAsSingleObject allProcs contentType isInvPost =
then length params == 1 && (firstType == Just "json" || firstType == Just "jsonb")
-- If the function has no parameters, the arguments keys must be empty as well
else if null params
then null argumentsKeys && contentType `notElem` [CTTextPlain, CTOctetStream]
then null argumentsKeys && not (isInvPost && contentType `elem` [CTTextPlain, CTOctetStream])
-- A function has optional and required parameters. Optional parameters have a default value and
-- don't require arguments for the function to be executed, required parameters must have an argument present.
else case L.partition ppReq params of