public override string GetBaseUrl(IRequest httpReq)
or
public override string ResolveAbsoluteUrl(string virtualPath, IRequest httpReq)
wont let me override ‘WebHostUrl’ im case of the initial request.
Given:
I’m accesing the api via a port forward.
I have no default.cshtml
When visiting http://external _url:10001, wich forwards tot the device, it will redirect me to http://localhost:8000/metadata, wich is the original URL the Api is started on. No difference if i setup DefaultRedirectLocation to something in the API, it will just put http://localhost:8000 in front of that then.
The first request i do, returns a 302 StatusCode, with a Location Header to the ‘wrong’ URI.
I just cant find where or how i can override this. I cant use WebHostUrl in HostConfig, because it’s static, and i need it to be request based dynamic.
It seems the update to 4.5.11 doesn’t account this redirect kind of request to /metadata or something else; it still does the same thing, even if i put ~/metadata (e.g.) in the DefaultRedirectPath.
However, with the RawHttpHandler there is something i got working now.
Apologies for that, the BaseUrl was being cached which prevented it from calling ResolveAbsoluteUrl() which should be resolved from this commit. Can you try using a ~/ url again with the latest v4.5.11 version on MyGet, You’ll need to clear your NuGet cache in order to re-download the latest v4.5.11 packages.