1
0
mirror of https://github.com/salvadordf/CEF4Delphi.git synced 2025-11-23 21:34:53 +02:00

Dump header information in SimpleServer demo

This commit is contained in:
Salvador Díaz Fau
2025-11-10 18:41:36 +01:00
parent 5a5548141d
commit 936afd0f20
2 changed files with 14 additions and 2 deletions

View File

@@ -14,7 +14,7 @@ uses
Controls, Forms, Dialogs, StdCtrls, Spin, ExtCtrls, Math, Controls, Forms, Dialogs, StdCtrls, Spin, ExtCtrls, Math,
ShellAPI, ShellAPI,
{$ENDIF} {$ENDIF}
uCEFInterfaces, uCEFServerComponent, uCEFTypes, uCEFMiscFunctions; uCEFInterfaces, uCEFServerComponent, uCEFTypes, uCEFMiscFunctions, uCEFStringMultimap;
type type
TSimpleServerFrm = class(TForm) TSimpleServerFrm = class(TForm)
@@ -140,6 +140,9 @@ begin
end; end;
procedure TSimpleServerFrm.ShowRequestInfo(const aRequest : ICefRequest); procedure TSimpleServerFrm.ShowRequestInfo(const aRequest : ICefRequest);
var
TempHeaderMap : ICefStringMultimap;
i : NativeUInt;
begin begin
if (aRequest = nil) then exit; if (aRequest = nil) then exit;
@@ -149,6 +152,15 @@ begin
if (length(aRequest.ReferrerUrl) > 0) then if (length(aRequest.ReferrerUrl) > 0) then
ConnectionLogMem.Lines.Add('Request Referrer : ' + aRequest.ReferrerUrl); ConnectionLogMem.Lines.Add('Request Referrer : ' + aRequest.ReferrerUrl);
TempHeaderMap := TCefStringMultimapOwn.Create;
aRequest.GetHeaderMap(TempHeaderMap);
i := 0;
while (i < TempHeaderMap.Size) do
begin
ConnectionLogMem.Lines.Add('HTTP header : ' + TempHeaderMap.Key[i] + ':' + TempHeaderMap.Value[i]);
inc(i);
end;
ShowPostDataInfo(aRequest.PostData); ShowPostDataInfo(aRequest.PostData);
end; end;

View File

@@ -2,7 +2,7 @@
"UpdateLazPackages" : [ "UpdateLazPackages" : [
{ {
"ForceNotify" : true, "ForceNotify" : true,
"InternalVersion" : 817, "InternalVersion" : 818,
"Name" : "cef4delphi_lazarus.lpk", "Name" : "cef4delphi_lazarus.lpk",
"Version" : "142.0.8" "Version" : "142.0.8"
} }