Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
IWServerControllerBaseBeforeNewSession
#2
If you just set the vCanCreate parameter to False, IW will take care of that for you responding with the SessionOptions.HttpStatusForDeniedSessions response code, which is by default 404, the most recommended for this situation.

Code:
procedure TIWServerController.IWServerControllerBaseBeforeNewSession(
  const aUrlPath: string; aRequest: THttpRequest; out vCanCreate: Boolean);
begin
  vCanCreate := False;
end;

IMO this is the closest to "pretend that it doesn't exist" that you can get after receiving the request (because the other side, the browser, knows that your server effectively exists because it accepted a connection and the request)
Reply


Messages In This Thread
RE: IWServerControllerBaseBeforeNewSession - by Alexandre Machado - 04-17-2023, 08:18 PM

Forum Jump:


Users browsing this thread: 1 Guest(s)