Skip to content
Permalink
Browse files

Resolve BaseUrl not including handlerPath in non SS requests

  • Loading branch information...
mythz committed Jun 1, 2019
1 parent eecc821 commit 612083bfc7319a70d08755196ef1b557ef2040fb
@@ -56,11 +56,11 @@ public override string GetBaseUrl(IRequest httpReq)
if (baseUrl != null)
return baseUrl.NormalizeScheme(useHttps);

var handlerPath = Config.HandlerFactoryPath;
baseUrl = httpReq.AbsoluteUri.InferBaseUrl(fromPathInfo: httpReq.PathInfo);
if (baseUrl != null)
return baseUrl.NormalizeScheme(useHttps);

var handlerPath = Config.HandlerFactoryPath;
if (baseUrl != null && baseUrl.EndsWith(handlerPath))
return baseUrl.NormalizeScheme(useHttps);

var aspReq = (HttpRequestBase)httpReq.OriginalRequest;
baseUrl = aspReq.Url.Scheme + "://" + aspReq.Url.Authority +
@@ -1,5 +1,6 @@
using System;
using System.Web.Mvc;
using dtos;
using ServiceStack;
using ServiceStack.Mvc;

@@ -63,5 +64,12 @@ public ActionResult Contact()

return View(GetViewModel("Contact"));
}

public ActionResult Hello()
{
var uri = new GetExample().ToAbsoluteUri();
ViewBag.Message = uri;
return View();
}
}
}
@@ -0,0 +1,3 @@
<h1>Absolute URI</h1>

<h3>@ViewBag.Message</h3>

0 comments on commit 612083b

Please sign in to comment.
You can’t perform that action at this time.