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,
ShellAPI,
{$ENDIF}
uCEFInterfaces, uCEFServerComponent, uCEFTypes, uCEFMiscFunctions;
uCEFInterfaces, uCEFServerComponent, uCEFTypes, uCEFMiscFunctions, uCEFStringMultimap;
type
TSimpleServerFrm = class(TForm)
@@ -140,6 +140,9 @@ begin
end;
procedure TSimpleServerFrm.ShowRequestInfo(const aRequest : ICefRequest);
var
TempHeaderMap : ICefStringMultimap;
i : NativeUInt;
begin
if (aRequest = nil) then exit;
@@ -149,6 +152,15 @@ begin
if (length(aRequest.ReferrerUrl) > 0) then
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);
end;