Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
AccessViol after moving from 15.2.18 to 15.2.25
#4
(05-07-2021, 08:31 PM)joelcc Wrote: I am doing a check in TController.IWServerControllerBaseBrowserCheck( aSession: TIWApplication; var rBrowser: TBrowser);

var
  luas : String; // UserAgentString

begin

  luas := Lowercase(ASession.Request.UserAgent)

I now get an accessviolation when I try to access the UserAgent.

Any ideas?


You didn't show the call stack, but I'm sure that ASession is not assigned.

As a rule of thumb, all events in ServerController where a TIWApplication instance is passed as a parameter *must* be checked for a valid session.

It is not guaranteed that a session exists in many of them.

BTW this code is not necessary at all. All these crawlers are already blocked by IW as long as ServerController.SessionOptions.AllowSearchEngines is false. Also, if the browser is not recognized, a standard TChrome instance will be created (90%+ chance that a webkit browser is being used).
Reply


Messages In This Thread
RE: AccessViol after moving from 15.2.18 to 15.2.25 - by Alexandre Machado - 05-11-2021, 10:20 AM

Forum Jump:


Users browsing this thread: 1 Guest(s)