From 7d4844919bdb8776c21da2822effe27873885eaa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C3=ABl=20Van=20Canneyt?= Date: Tue, 28 Dec 2021 15:26:37 +0100 Subject: [PATCH] * Initialize APIRequestName --- packages/fcl-web/src/jsonrpc/webjsonrpc.pp | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/packages/fcl-web/src/jsonrpc/webjsonrpc.pp b/packages/fcl-web/src/jsonrpc/webjsonrpc.pp index f9bdf94574..1b30d27993 100644 --- a/packages/fcl-web/src/jsonrpc/webjsonrpc.pp +++ b/packages/fcl-web/src/jsonrpc/webjsonrpc.pp @@ -270,10 +270,13 @@ end; function TCustomJSONRPCModule.IsAPIRequest(ARequest: TRequest): Boolean; begin Result:=False; - if (asURL in APIRequestSources) then - Result:=SameText(aRequest.GetNextPathInfo,APIRequestName); - if (asQuery in APIRequestSources) then - Result:=Result or (aRequest.QueryFields.Values[APIRequestName]<>''); + if APIRequestName<>'' then + begin + if (asURL in APIRequestSources) then + Result:=SameText(aRequest.GetNextPathInfo,APIRequestName); + if (asQuery in APIRequestSources) then + Result:=Result or (aRequest.QueryFields.Values[APIRequestName]<>''); + end; end; @@ -292,6 +295,7 @@ begin FOptions := DefaultDispatchOptions+[jdoSearchRegistry]; APIRequestSources := DefaultAPIRequestSources; APICreateOptions:=[caoFullParams]; + APIRequestName:='API'; end; Function TCustomJSONRPCModule.GetAPI(aDisp : TCustomJSONRPCDispatcher; ARequest: TRequest) : TJSONStringType;