Strange Heart Beat URL Generation

Hello,

I’ve a following deployment configuration. I’ve Web Backend ASP.NET application that an application in a browser working with and Services ASP.NET application that the Backend app is querying for services. What rather untraditional in this configuration is that both applications are deployed into same IIS and website and reside in different AppPools.

The URL for the Backend application is http://<host>/meiwi and for Services app http://<host>/meiwi.services

The browser opens SSE channel/subscription vs. Backend application. However, the heart beat URL that it receives on connection is defined http://<host>/meiwi.serivces/heartbeat?...

It’s happening because a call to HostContext.GetCurrentRequest().GetBaseUrl() returns http://<host>/meiwi.services although the subscription was issued with http://<host>/meiwi (according to Fiddler).

When a deployment configuration includes only one ASP.NET application the generation of the heart beat URL works correctly.

Does anyone have an idea what can be a reason for this weird behavior?

NOTE: Applications are running in different Application Pools.

Thank you

Are you sure your configuration issues is limited to Heartbeat? Is everything else work fine from both Web Applications, i.e. you can access other requests from both applications? Try accessing ?debug=requestinfo from both applications to see if both applications are returning the correct configuration.

I suspect the conflict is due to having different applications share the same path, i.e. having both /meiwi and /meiwi.services for 2 different applications.

IRequest.GetBaseUrl() is built from the HttpRequest.Url of the underlying ASP.NET Request, this is what ASP.NET is reporting the incoming request to be, you can override the BaseUrl that’s returned by setting Config.WebHostUrl, but this is likely just masking the underlying issue.