|
@@ -506,6 +506,7 @@ type
|
|
|
Public
|
|
|
Constructor Create(AOwner : TComponent);override;
|
|
|
Procedure HandleRequest(ARequest : TRequest; AResponse : TResponse); override;
|
|
|
+ Property Document : THTMLDocument Read FDocument;
|
|
|
end;
|
|
|
|
|
|
TFPHTMLModule=Class(TCustomHTMLModule)
|
|
@@ -1167,13 +1168,21 @@ begin
|
|
|
If Assigned(OnGetContent) then
|
|
|
OnGetContent(Self,ARequest,FWriter,B);
|
|
|
If Not B then
|
|
|
- Raise EHTMLError.Create(SErrRequestNotHandled);
|
|
|
- If (AResponse.ContentStream=Nil) then
|
|
|
begin
|
|
|
- M:=TMemoryStream.Create;
|
|
|
- AResponse.ContentStream:=M;
|
|
|
+ Actions.HandleRequest(ARequest,FWriter,B);
|
|
|
+ If Not B then
|
|
|
+ Raise EHTMLError.Create(SErrRequestNotHandled);
|
|
|
+ end
|
|
|
+ else
|
|
|
+ begin
|
|
|
+ If (AResponse.ContentStream=Nil) then
|
|
|
+ begin
|
|
|
+ M:=TMemoryStream.Create;
|
|
|
+ AResponse.ContentStream:=M;
|
|
|
+ AResponse.FreeContentStream:=True;
|
|
|
+ FDocument.SaveToStream(AResponse.ContentStream);
|
|
|
+ end;
|
|
|
end;
|
|
|
- FDocument.SaveToStream(AResponse.ContentStream);
|
|
|
Finally
|
|
|
FreeAndNil(FWriter);
|
|
|
end;
|