As far as I understand, Request.IsLocal returns true in two scenarios. If the IP address of the request sender is 127.0.0.1 or if the IP address of the request matches the IP address of the server.
I use this on a page that is regularly called by the cron task (using an absolute URL). Unfortunately, this cron job runs on the same server as the page, which means that IsLocal always returns true.
Ideally, I need a function that just returns true if I am on a local host. How to do it in ASP.NET MVC?
source share