feat: support OPTIONS on RPC and root path

This commit is contained in:
steve-chavez
2022-07-17 18:40:14 -05:00
committed by Steve Chavez
parent 71a5748718
commit 2eb7c803e3
6 changed files with 63 additions and 27 deletions
+1 -1
View File
@@ -193,7 +193,7 @@ getPathInfo AppConfig{configOpenApiMode, configDbRootSpec} path =
getAction :: PathInfo -> ByteString -> Either ApiRequestError Action
getAction PathInfo{pathIsProc, pathIsDefSpec} method =
if pathIsProc && method `notElem` ["HEAD", "GET", "POST"]
if pathIsProc && method `notElem` ["HEAD", "GET", "POST", "OPTIONS"]
then Left $ InvalidRpcMethod method
else case method of
-- The HEAD method is identical to GET except that the server MUST NOT return a message-body in the response