1
Views
1
Comments
How to determine IsLocalUrl ?
Question
During a security check on one of our projects, the advice came to have only local URL's possible to the login webscreen.
The login webscreen has an input OriginalURL ... and redirects to any URL passed into it

We got the advice to do something like this:

public bool IsLocalUrl(string url) {
  return System.Web.WebPages.RequestExtensions.IsUrlLocalToHost(  RequestContext.HttpContext.Request, url);
}

Anybody got a solution in OutSystems for this ?
2019-11-12 17-31-26
Justin James
 
MVP
You can check the actual server name (GetMachineName and GetMachineInternalName in HtmlRenderer) in the request and compare it to the URL requested (GetURL in HTTPRequestHandler).

J.Ja
Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.