Welcome to the SRP Forum! Please refer to the SRP Forum FAQ post if you have any questions regarding how the forum works.
url with port number issue
url calling the myapi:
http://clientweb.com.au:8081/fes-api/myapi/login
returning values, the ParentUrl = http://clientweb.com.au/fes-api/myapi/workorder?date=30/6/2022
i.e. the :8081 is getting stripped
Is there any setup that will fix this issue.
(sorry if I am supposed to find in the documentation)
http://clientweb.com.au:8081/fes-api/myapi/login
returning values, the ParentUrl = http://clientweb.com.au/fes-api/myapi/workorder?date=30/6/2022
i.e. the :8081 is getting stripped
Is there any setup that will fix this issue.
(sorry if I am supposed to find in the documentation)
Comments
But according to the i
The HTTP Framework relies upon data coming in through the Request dynamic array that the OECGI passes through. In position 19 of that array, which is called HTTP Server Name, the URL used to make the request is stored. This is where we derive the URL. Likewise, in position 20 of that array, which is called HTTP Server Port, the port number used to make the request is also stored.
The problem is that the HTTP Server Name does not include the port number even if the client specifies it. Thus, the Request dynamic array looks the same whether the specified URL looks like this:
http://clientweb.com.au
or
http://clientweb.com.au:80
Both would look like this in the Request dynamic array:
<19> clientweb.com.au
<20> 80
I realize that in your case the port is 8081. However, the Framework has no way of knowing whether this port was appended in the URL originally so it doesn't know to append it to any URLs that are sent back in the response.
You can add code to force this if you want, but this would be a custom change that should be done in a localized copy of the relevant routines.
FullEndpointURLPort = HTTP_Services('GetFullEndpointURL') : ':' : HTTP_Services('GetHTTPServerPort')
Then you can use your flag to determine if various routines should use FullEndpointURL or FullEndpointURLPort when building the response.
I have gone this way which works for me and can see what is happening in one place.
SaveParentUrl =ParentUrl HttpSetupKey = SetupRowKeyID$:"*":OIAccount HttpSetupRecord =xlate(SetupTable$,HttpSetupKey,'','X') HttpSetUpUrl = HttpSetupRecord<HTTP_FRAMEWORK_SETUP_HOME_URL$> if len(HttpSetUpUrl) then HttpSetupApiUrl =HttpSetupRecord<HTTP_FRAMEWORK_SETUP_API_URL$> if HttpSetUpUrl[-1,1]='/' then HttpSetUpUrl[-1,1] ='' end ParentUrl =HttpSetUpUrl:HttpSetupApiUrl:'/':"myapi" end
SaveParentUrl =ParentUrl HttpSetupKey = SetupRowKeyID$:"*":OIAccount HttpSetupRecord =xlate(SetupTable$,HttpSetupKey,'','X') HttpSetUpUrl = HttpSetupRecord<HTTP_FRAMEWORK_SETUP_HOME_URL$> if len(HttpSetUpUrl) then NoUrlParentUrl =field(ParentUrl,'/',4,len(ParentUrl)) ParentUrl =HttpSetUpUrl:"/":NoUrlParentUrl end