In a web app written in VB.NET .NET 4.0, using VS 2012, there is this line:
serverPort = CInt(HttpContext.Current.Request.ServerVariables("SERVER_PORT"))
serverName = HttpContext.Current.Request.ServerVariables("SERVER_NAME")
If serverPort = nonsecurePort And serverName.Contains("MyWebSite.com") Then
more code if both clauses are true
end if
As it turns out, nonsecurePort = 8089 and in this case serverport is 80 so we think should means the the app will not execute the code in the if clause, as the serverport is not equal to the nonsecurePort.
BUT in fact, we watch the code go right into code and we do not understand why. This is an ASP.NET app. We published it to a DEV web server and are debugging it remotely.
Why could this happen?