Fix 'Application.Host' and 'Application.Port'. The port is not stored in CGI["SERVER_PORT"], but in the port part of CGI["HTTP_HOST"].

[GB.WEB]
* BUG: Fix 'Application.Host' and 'Application.Port'. The port is not stored in CGI["SERVER_PORT"], but in the port part of CGI["HTTP_HOST"].
This commit is contained in:
Benoît Minisini 2023-10-28 09:59:36 +02:00
parent 74eeb810af
commit 685037ef54

View File

@ -16,7 +16,13 @@ Private $sRoot As String
Private Function Host_Read() As String
Return CGI["HTTP_HOST"]
Dim sHost As String
Dim iPos As Integer
sHost = CGI["HTTP_HOST"]
iPos = RInStr(sHost, ":")
If iPos Then sHost = Left(sHost, iPos - 1)
Return sHost
End
@ -80,6 +86,13 @@ End
Private Function Port_Read() As String
Return CGI["SERVER_PORT"]
Dim sHost As String
Dim iPos As Integer
Dim sPort As String
sHost = CGI["HTTP_HOST"]
iPos = RInStr(sHost, ":")
If iPos Then sPort = Mid$(sHost, iPos + 1)
Return sPort
End