You are not logged in.
I found error in OnBeforeBody event that results from using WITH and the name of a local variable such as object field.
The RemoteIP parameter is passed to the OnBeforeBody event as an empty string (this is the value of Context.RemoteIP field) even though the local variable contains the correct value.
procedure THttpApiServer.Execute;
[...]
var
[...]
RemoteIP: SockString;
Context : THttpServerRequest;
[...]
[...]
begin
[...]
if Assigned(OnBeforeBody) then begin
with Context do <-------------------- this 'with' cause a problem
Err := OnBeforeBody(URL,Method,InHeaders,InContentType,RemoteIP,InContentLength,fUseSSL); <--- RemoteIP is taken from Context object, not from local variable
THttpServerRequest = class
[...]
public
[...]
property RemoteIP: SockString read fRemoteIP write fRemoteIP;
end;
Last edited by jaclas (2020-02-19 12:40:06)
Offline
Fixed by https://synopse.info/fossil/info/6d00d4e081
Damned "with" !!!
Offline