|
@@ -75,14 +75,20 @@ end;
|
|
|
|
|
|
function TCGIApplication.GetModuleName(Arequest: TRequest): string;
|
|
|
|
|
|
+Var
|
|
|
+ S : String;
|
|
|
+
|
|
|
begin
|
|
|
If (FModuleVar<>'') then
|
|
|
Result:=ARequest.QueryFields.Values[FModuleVar];//Module name from query parameter using the FModuleVar as parameter name (default is 'Module')
|
|
|
If (Result='') then
|
|
|
- begin
|
|
|
- if (Pos('/', ARequest.PathInfo[2]) <= 0) and AllowDefaultModule then Exit;//There is only 1 '/' in ARequest.PathInfo -> only ActionName is there -> use default module
|
|
|
+ begin
|
|
|
+ S:=ARequest.PathInfo;
|
|
|
+ Delete(S,1,1);
|
|
|
+ if (Pos('/',S) <= 0) and AllowDefaultModule then
|
|
|
+ Exit;//There is only 1 '/' in ARequest.PathInfo -> only ActionName is there -> use default module
|
|
|
Result:=ARequest.GetNextPathInfo;
|
|
|
- end;
|
|
|
+ end;
|
|
|
end;
|
|
|
|
|
|
function TCGIApplication.FindModule(ModuleClass : TCustomHTTPModuleClass): TCustomHTTPModule;
|
|
@@ -139,10 +145,15 @@ begin
|
|
|
Raise EFPCGIError.CreateFmt(SErrNoModuleForRequest,[MN]);
|
|
|
end;
|
|
|
MC:=MI.ModuleClass;
|
|
|
- M:=FindModule(MC); // Check if a module exists already
|
|
|
end;
|
|
|
+ M:=FindModule(MC); // Check if a module exists already
|
|
|
If (M=Nil) then
|
|
|
- M:=MC.Create(Self);
|
|
|
+ begin
|
|
|
+ If MC.UseStreaming then
|
|
|
+ M:=MC.Create(Self)
|
|
|
+ else
|
|
|
+ M:=MC.CreateNew(Self,0);
|
|
|
+ end;
|
|
|
M.HandleRequest(ARequest,AResponse);
|
|
|
end;
|
|
|
|